Skip to content

Commit

Permalink
Dont realloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ortmann committed Mar 17, 2024
1 parent 4703f71 commit 104f213
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/mod/channels.mod/tclchan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2000,15 +2000,11 @@ static void init_channel(struct chanset_t *chan, int reset)
int flags = reset ? reset : CHAN_RESETALL;

if (flags & CHAN_RESETWHO) {
if (chan->channel.member) {
nfree(chan->channel.member);
}
chan->channel.members = 0;
chan->channel.member = nmalloc(sizeof *chan->channel.member);
if (!chan->channel.member)
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 104f213

Please sign in to comment.