Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove static mut in chgrp tests and fix memleak inside get_groups #386

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

JRF63
Copy link
Contributor

@JRF63 JRF63 commented Feb 9, 2025

rustc and rust-analyzer issues a warning on the use of static mut globals hence the change to a RwLock.

The memory leak was from libc::malloc not being accompanied by a corresponding libc::free. There are multiple exit points (from the panics) so it's simpler to just RAII it with a Vec.

@jgarzik jgarzik merged commit 0c321b0 into rustcoreutils:main Feb 9, 2025
2 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants