X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fcommand_reply.c;fp=lib%2Fsilcclient%2Fcommand_reply.c;h=13fab10a168ad506500ec3996b8be031ef4c3ccd;hb=5435a706713661b0e5d3744d27b14ecae977ca45;hp=5c64922e3992af206be3aded6576c9f6a421f96c;hpb=03485d34414f8fdeeb28d92c817bc127a67513c7;p=silc.git diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index 5c64922e..13fab10a 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -131,7 +131,7 @@ void silc_client_command_reply_process(SilcClient client, /* No specific identifier for command reply, call first one found */ (*reply)(ctx, NULL); else - silc_free(ctx); + silc_client_command_reply_free(ctx); } } @@ -155,6 +155,8 @@ void silc_client_command_reply_free(SilcClientCommandReplyContext cmd) SILC_LOG_DEBUG(("Command reply context %p refcnt %d->%d", cmd, cmd->users + 1, cmd->users)); if (cmd->users < 1) { + if (cmd->callbacks) + silc_free(cmd->callbacks); silc_command_payload_free(cmd->payload); silc_free(cmd); } @@ -934,7 +936,7 @@ SILC_CLIENT_CMD_REPLY_FUNC(ping) { SilcClientCommandReplyContext cmd = (SilcClientCommandReplyContext)context; SilcClientConnection conn = (SilcClientConnection)cmd->sock->user_data; - void *id; + void *id = NULL; int i; time_t diff, curtime; @@ -972,12 +974,12 @@ SILC_CLIENT_CMD_REPLY_FUNC(ping) } } - silc_free(id); - /* Notify application */ COMMAND_REPLY((SILC_ARGS)); out: + if (id) + silc_free(id); SILC_CLIENT_PENDING_EXEC(cmd, SILC_COMMAND_PING); silc_client_command_reply_free(cmd); }