From 15f756b6848facda4568f1a0d98bc1843f8d0ee9 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 6 May 2007 20:04:05 +0000 Subject: [PATCH] Memory leak fixes. --- lib/silcclient/command.c | 9 ++++++--- lib/silcclient/silcclient.h | 11 ++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/silcclient/command.c b/lib/silcclient/command.c index 19b9fc6c..86ce6acb 100644 --- a/lib/silcclient/command.c +++ b/lib/silcclient/command.c @@ -727,11 +727,14 @@ SILC_FSM_STATE(silc_client_command_whois) SILC_ATTRIBUTE_USER_PUBLIC_KEY, SILC_ATTRIBUTE_FLAG_VALID, &obj, sizeof(obj)); + silc_free(obj.data); } - silc_client_nickname_parse(client, conn, cmd->argv[1], &nickname); - if (!nickname) - nickname = strdup(cmd->argv[1]); + if (nick) { + silc_client_nickname_parse(client, conn, cmd->argv[1], &nickname); + if (!nickname) + nickname = strdup(cmd->argv[1]); + } /* Send command */ silc_client_command_send_va(conn, cmd, cmd->cmd, NULL, NULL, diff --git a/lib/silcclient/silcclient.h b/lib/silcclient/silcclient.h index 21b4dc82..622670b3 100644 --- a/lib/silcclient/silcclient.h +++ b/lib/silcclient/silcclient.h @@ -754,10 +754,10 @@ void silc_client_free(SilcClient client); * operating system, `hostname' is the client's host name and the * `realname' is the user's real name. * - * The `running' callback is called after the client is running after - * silc_client_run or silc_client_run_one has been called. Application - * may start using the Client library API after that. Setting the - * callback is optional, but recommended. + * The `running' callback with `context' is called after the client is + * running after silc_client_run or silc_client_run_one has been called. + * Application may start using the Client library API after that. Setting + * the callback is optional, but recommended. * ***/ SilcBool silc_client_init(SilcClient client, const char *username, @@ -1049,7 +1049,8 @@ silc_client_connect_to_client(SilcClient client, * session. The `callback' with `context' will be called after the session * has been set up. It will also be called later when remote host * disconnects. The `conn_type' is the type of session this is going to - * be. + * be. If the remote is SILC server it is SILC_CONN_SERVER or if it is + * SILC client it is SILC_CONN_CLIENT. * * Returns SilcAsyncOperation which can be used to cancel the connecting, * or NULL on error. Note that the returned pointer becomes invalid -- 2.24.0