Skip to content

Commit

Permalink
Fix leak
Browse files Browse the repository at this point in the history
Patch by: michaelortmann
  • Loading branch information
michaelortmann authored Jun 2, 2024
1 parent 9068233 commit 0ee04c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mod/channels.mod/tclchan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,17 +1998,17 @@ static void init_masklist(masklist *m)
static void init_channel(struct chanset_t *chan, int reset)
{
int flags = reset ? reset : CHAN_RESETALL;
memberlist *m, *m1;

if (flags & CHAN_RESETWHO) {
if (chan->channel.member) {
nfree(chan->channel.member);
for (m = chan->channel.member; m; m = m1) {
m1 = m->next;
nfree(m);
}
chan->channel.members = 0;
chan->channel.member = nmalloc(sizeof *chan->channel.member);
/* Since we don't have channel_malloc, manually bzero */
egg_bzero(chan->channel.member, sizeof *chan->channel.member);
chan->channel.member->nick[0] = 0;
chan->channel.member->next = NULL;
}

if (flags & CHAN_RESETMODES) {
Expand Down

0 comments on commit 0ee04c2

Please sign in to comment.