-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
libvector/diglib: fix memory leaks #3617
Conversation
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 don't like goto
in C code, but the usage here seems ok:
Have you observed actual memory leaks that are fixed by this PR?
This code is a correct reason why |
I reluctantly agree. It seems that |
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 was already pretty sure of this, but with the discussion here, my last doubts are addressed.
This is as far as I personally would go to use goto: simple memory clean up operations. It has the advantage to make sure everything get released, without repeating code or creating additional clean-up functions (for every function). |
The leaks are reported by Coverity. The issues were fixed according to the testing of my fork against Coverity. |
Fix some memory leaks in
lib/vector/diglib
exposed by static analysis.