Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix many memory issues found with valgrind #9

Closed
wants to merge 2 commits into from

Conversation

johnlepikhin
Copy link

Using Valgrind I found many memory related issues and tried to fix them all. The main idea is to explicitly release CStrings only after they been used by liblxc.

Also code was reformatted with rustfmt.

@sanpii
Copy link
Owner

sanpii commented Dec 21, 2019

Ok, I understand what I’m doing wrong. The ffi::to_cstr() function isn’t a good idea.

But I dislike the idea to have alloc/release pattern like in C, I prefer duplicated code to let rustc deal with memory.

@sanpii sanpii closed this in 4494a4f Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants