Memory leak fixes.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 18 Feb 2007 10:09:19 +0000 (10:09 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 18 Feb 2007 10:09:19 +0000 (10:09 +0000)
lib/doc/LIBINDEX
lib/silcapputil/silcapputil.h
lib/silcclient/client.c
lib/silcclient/client_connect.c
lib/silcclient/client_ftp.c
lib/silccore/silcpacket.c
lib/silcutil/silcmutex.h

index ece0a0a7152a7fd2e1f856b699dcf548c02dcc23..ebecb16cbb2ae576b0a6d558e7d6ca346849baa6 100644 (file)
@@ -25,6 +25,8 @@ Toolkit sources, and the documentation is constantly evolving.  New versions
 of the Toolkit always delivers the latest version of this reference manual.
 
 <br /><br /><br />
+<li><a href="new.html">What's new in Toolkit 1.1</a><br />
+<li><a href="porting.html">Porting from Toolkit 1.0 to 1.1</a><br />
 <li><a href="intro_reference.html">Introduction to the Manual</a><br />
 <li><a href="programming_conv.html">Programming Conventions</a><br />
 <li><a href="building.html">Building the Toolkit</a>
index 31964a46a0701eaddffa9073640fb08e86511336..f4858d2ad6c31ef8d70a101a560989b28714c5d3 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2002 - 2006 Pekka Riikonen
+  Copyright (C) 2002 - 2007 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -289,10 +289,10 @@ unsigned char *silc_channel_name_check(const unsigned char *identifier,
  * SYNOPSIS
  *
  *    SilcBool
- *    silc_channel_name_check(const unsigned char *identifier,
- *                            SilcUInt32 identifier_len,
- *                            SilcStringEncoding identifier_encoding,
- *                            SilcUInt32 max_allowed_length);
+ *    silc_channel_name_veirfy(const unsigned char *identifier,
+ *                             SilcUInt32 identifier_len,
+ *                             SilcStringEncoding identifier_encoding,
+ *                             SilcUInt32 max_allowed_length);
  *
  * DESCRIPTION
  *
index 1d7884553696564c1dd8bca8477034cfc25760ce..c939fa7b1d924a11f866832075a8ce099d9c3c9a 100644 (file)
@@ -867,13 +867,6 @@ void silc_client_close_connection(SilcClient client,
 {
   SILC_LOG_DEBUG(("Closing connection %p", conn));
 
-  /* If connection machine is not running, we just delete the connection */
-  if (!silc_fsm_is_started(&conn->internal->fsm)) {
-    silc_packet_stream_destroy(conn->stream);
-    silc_client_del_connection(conn->client, conn);
-    return;
-  }
-
   /* Signal to close connection */
   conn->internal->status = SILC_CLIENT_CONN_DISCONNECTED;
   if (!conn->internal->disconnected) {
index 06f6a71378fdc3723d90da197b117ec079ba61bd..57911639ce2627bda913340dc721c43be73140d5 100644 (file)
@@ -267,6 +267,9 @@ static void silc_client_rekey_completion(SilcSKE ske,
   silc_ske_free_rekey_material(conn->internal->rekey);
   conn->internal->rekey = rekey;
 
+  silc_ske_free(conn->internal->ske);
+  conn->internal->ske = NULL;
+
   SILC_LOG_DEBUG(("Rekey completed conn %p", conn));
 
   /* Rekey done */
index 42e22d15189e40564bc3126c5ebdb23d280c719c..ead3a04ec084bf4f36245e9e2413a86cc2a3dfbb 100644 (file)
@@ -967,7 +967,7 @@ SILC_FSM_STATE(silc_client_ftp)
   SilcClientFtpSession session;
   SilcClientID remote_id;
   SilcClientEntry remote_client;
-  SilcKeyAgreementPayload payload;
+  SilcKeyAgreementPayload payload = NULL;
   char *hostname;
   SilcUInt16 port;
 
@@ -1079,6 +1079,8 @@ SILC_FSM_STATE(silc_client_ftp)
   }
 
  out:
+  if (payload)
+    silc_key_agreement_payload_free(payload);
   silc_packet_free(packet);
   return SILC_FSM_FINISH;
 }
index 94fcffc71146e16bdbd73dfedde4d51186920f9f..661fbbe47e53eff3bee4c8c0c19035ae1ef43ea2 100644 (file)
@@ -2633,11 +2633,7 @@ SilcStream silc_packet_stream_wrap(SilcPacketStream stream,
     }
   } else {
     /* Non-blocking mode */
-    if (!silc_mutex_alloc(&pws->lock)) {
-      silc_free(pws);
-      return NULL;
-    }
-
+    silc_mutex_alloc(&pws->lock);
     silc_list_init(pws->in_queue, struct SilcPacketStruct, next);
   }
 
index 82a9da3922130fb76549f8424ed67fefc52896ed..070a2e9a3e0e774e5e0934cb084eb0680efb1ed4 100644 (file)
@@ -71,7 +71,8 @@ typedef struct SilcRwLockStruct *SilcRwLock;
  *    Allocates SILC Mutex object.  The mutex object must be allocated
  *    before it can be used.  It is freed by the silc_mutex_free function.
  *    This returns TRUE and allocated mutex in to the `mutex' and FALSE
- *    on error.
+ *    on error.  If threads support is not compiled in this returns FALSE,
+ *    but should not be considered as an error.
  *
  ***/
 SilcBool silc_mutex_alloc(SilcMutex *mutex);