From: Pekka Riikonen Date: Wed, 6 Apr 2005 19:46:05 +0000 (+0000) Subject: Fixed bad silc_free from WHOIS command reply. X-Git-Tag: silc.server.0.9.19p1 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=550a81d6a213e107485f5ce8920c98448a3ec75b;hp=a6acb325edb2980d633e57d53a94cff9b3e5ce78 Fixed bad silc_free from WHOIS command reply. --- diff --git a/CHANGES b/CHANGES index 75ccd8ef..1c756242 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ Wed Apr 6 16:56:53 EEST 2005 Pekka Riikonen * Handle error in WATCH command propely on backup router. Affected file silcd/command.c. + * Fixed freeing of unfreeable variable in WHOIS command reply. + Affected file silcd/command_reply.c. + Wed Apr 6 09:10:31 CEST 2005 Pekka Riikonen * Added pkg-config .pc file creation for silc core library diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index 5213596d..ecfeb474 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -177,7 +177,7 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd) SilcClientEntry client; SilcIDCacheEntry cache = NULL; char global = FALSE; - char *nick; + char *nick = NULL; SilcUInt32 mode = 0, len, len2, id_len, flen; id_data = silc_argument_get_arg_type(cmd->args, 2, &id_len); @@ -224,11 +224,10 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd) cmd->sock->user_data, NULL, 0); if (!client) { SILC_LOG_ERROR(("Could not add new client to the ID Cache")); - silc_free(tmp); silc_free(nick); + silc_free(servername); return FALSE; } - silc_free(tmp); client->data.status |= (SILC_IDLIST_STATUS_REGISTERED | SILC_IDLIST_STATUS_RESOLVED); @@ -465,7 +464,7 @@ silc_server_command_reply_whowas_save(SilcServerCommandReplyContext cmd) SilcClientID *client_id; SilcClientEntry client; SilcIDCacheEntry cache = NULL; - char *nick; + char *nick = NULL; int global = FALSE; id_data = silc_argument_get_arg_type(cmd->args, 2, &id_len); @@ -510,6 +509,7 @@ silc_server_command_reply_whowas_save(SilcServerCommandReplyContext cmd) if (!client) { SILC_LOG_ERROR(("Could not add new client to the ID Cache")); silc_free(nick); + silc_free(servername); return FALSE; }