Memory leak fixes.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 6 May 2007 20:04:05 +0000 (20:04 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 6 May 2007 20:04:05 +0000 (20:04 +0000)
lib/silcclient/command.c
lib/silcclient/silcclient.h

index 19b9fc6c07646ace947e14477d9593e2b893e639..86ce6acbbe490a4c734f5bf1c26cb30f9cdca4e1 100644 (file)
@@ -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,
index 21b4dc82469f6d163cc3658990612debd8a93c84..622670b32d16943a94da56c27556cde989896e2a 100644 (file)
@@ -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