Fix several memory leaks - #15
Merged
Merged
Conversation
added 3 commits
August 25, 2021 07:30
the issue addressed in this commit were initially identified and fixed by @WanzenBug
avalentino
approved these changes
Aug 25, 2021
Collaborator
|
Thanks a lot @dmarth and @WanzenBug. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some cases memory is not freed correctly. Primarily this concerns error handling code that does not clean up partially initialized data structures.
I was not able to clean up all memory leaks reported by
valgrindon the execution ofepr_main_test, because some of the leaks are more fundamental to the design of the API than just error handling. One example is the record information, which is intentionally not freed unless it is assigned to a product. Test cases that callepr_parse_headerdirectly never free the allocated memory. However, maybe this behavior can be accepted as it is covered by the high-level API.Note: Parts of this pull request were provided by @WanzenBug.