From 104f213803c9e2bca63439306de78342d42fc8cd Mon Sep 17 00:00:00 2001 From: Michael Ortmann Date: Sun, 17 Mar 2024 06:18:53 +0100 Subject: [PATCH] Dont realloc --- src/mod/channels.mod/tclchan.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mod/channels.mod/tclchan.c b/src/mod/channels.mod/tclchan.c index 512702703..e17252055 100644 --- a/src/mod/channels.mod/tclchan.c +++ b/src/mod/channels.mod/tclchan.c @@ -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) {