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
Memory leak fixes (in library, not extension code) #233
Memory leak fixes (in library, not extension code) #233
Conversation
|
Related issues that are not fixed in this PR: #232 (wasn't able to figure them out) |
src/compression_wrapper.c
Outdated
| @@ -929,12 +929,16 @@ cr_close(CR_FILE *cr_file, GError **err) | |||
| } | |||
|
|
|||
| if (cr_file->stat) { | |||
| if (cr_file->stat->hdr_checksum) { | |||
| free(cr_file->stat->hdr_checksum); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not the right place to free the hdr_checksum, it should be freed together with the rest of the stat struct, ideally by cr_contentstat_free. Its generally not bound to the cr_file, its managed on its own. In fact when running with zchunk (createrepo_c --zck .) this call is causing a double free.
I have looked around where the hdr_checksum could be leaking and I believe that the problem is here: https://github.com/rpm-software-management/createrepo_c/blob/master/src/repomd.c#L199
It should be using the cr_contentstat_free function.
Otherwise looks good to me. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
46a1ccf
to
8ae8a76
Compare
|
@kontura (re-do) Fixed now. Thank you! |
8ae8a76
to
bfa244a
Compare
No description provided.