-
-
Notifications
You must be signed in to change notification settings - Fork 78
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 several tiny memory leaks #428
Fix several tiny memory leaks #428
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.
Hi @Quipyowert2
Thanks, all look good. Not overly wild about the whole "Bool" checking in functions.c, but there's already a precendence for it.
See comments in-line for the FScreen.c change.
Can you also collapse these changes into one or two commits?
068b900
to
c898585
Compare
I added the error message you suggested and removed the |
c898585
to
9749b8d
Compare
Thanks, @Quipyowert2 I would use a commit message of:
|
In running fvwm3 through valgrind, this commit fixes a few memory leaks it has detected.
9749b8d
to
3a0afe5
Compare
//free(action_cpy); | ||
free(action_cpy_start); |
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.
Oops. Thanks for fixing this!
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.
PeekToken
moves action_cpy
forward a few bytes so I had to introduce another variable to be able to free the original pointer. Freeing action_cpy
directly caused an Invalid free error from valgrind since it was pointing into the middle of the allocated memory instead of the beginning.
You're welcome.
What does this PR do?
Fixes a series of very tiny leaks.
Screenshots (if applicable)
PR acceptance criteria (reminder only, please delete once read)
Your commit message(s) are descriptive. See:
https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[https://raw.githubusercontent.com/fvwmorg/fvwm3/master/doc/README]Documentation updated (where appropriate)
Style guide followed (try and match the surrounding code where possible)
All tests are passing: although this is automatic, Codacy will often
highlight additional considerations which will need to be addressed before
the PR can be merged.
Issue number(s)
If this PR addresses any issues, please ensure the appropriate commit
message(s) contains:
at the end of your commit message, where
XXX
should be replaced with therelevant issue number.
If there is more than one issue fixed then use: