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.
Found by: michaelortmann (or Mystery-X if this fixes #1545, but unlikely, see #1545 (comment))
Patch by: michaelortmann
Fixes:
One-line summary:
Fix memleak in
init_channel()
Additional description (if needed):
init_channel()
was only freeing the first element of a linked listLeak is triggered by the bot joining a channel and by use of
init_channel()
, like with.reset
.Fixing this leak could fix #1545, but it could- very likely - be a different leak.
We decided to ignore codacity code duplication warning here.
Test cases demonstrating functionality (if applicable):
$ valgrind --leak-check=full --show-leak-kinds=all --verbose ./eggdrop -t BotA.conf
make the bot join a channel and wait for the who reply
.die
the leak is shown like:
==320050== by 0x4868D36: init_channel (tclchan.c:2007)
more visually, one could add
char debug[1024 * 1024];
to the memberlist stuct in
src/chan.c
so that every leak would leak 1MB