Skip to content
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 memleak in init_channel() #1592

Merged
merged 2 commits into from
Jun 2, 2024

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented May 28, 2024

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 list
Leak 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

@vanosg vanosg added this to the v1.10.0 milestone Jun 2, 2024
@vanosg vanosg merged commit 0ee04c2 into eggheads:develop Jun 2, 2024
1 of 2 checks passed
@michaelortmann michaelortmann deleted the fix.leak.init.channel branch June 16, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eggdrop 1.9.5 - Possible memory leak in botnet communication?
2 participants