From 75c7dc822feb5343482d2f2ec2c6c6bf36c89cbc Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 9 Oct 2000 13:43:06 +0000 Subject: [PATCH] bugfix in remove_from_channels. --- apps/silcd/server.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 59746f07..ad62465d 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -2221,9 +2221,6 @@ void silc_server_remove_from_channels(SilcServer server, SilcChannelEntry channel; SilcBuffer id_payload; - id_payload = silc_id_payload_encode(channel->id, SILC_ID_CHANNEL_LEN, - SILC_ID_CHANNEL); - /* Remove the client from all channels. The client is removed from the channels' user list. */ for (i = 0; i < client->channel_count; i++) { @@ -2231,6 +2228,9 @@ void silc_server_remove_from_channels(SilcServer server, if (!channel) continue; + id_payload = silc_id_payload_encode(channel->id, SILC_ID_CHANNEL_LEN, + SILC_ID_CHANNEL); + /* Remove from channel */ for (k = 0; k < channel->user_list_count; k++) { if (channel->user_list[k].client == client) { @@ -2276,12 +2276,13 @@ void silc_server_remove_from_channels(SilcServer server, id_payload->len); } } + + silc_id_payload_free(id_payload); } if (client->channel_count) silc_free(client->channel); client->channel = NULL; - silc_buffer_free(id_payload); } /* Removes client from one channel. This is used for example when client -- 2.24.0