Mem leak fix.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 17 Jul 2003 13:20:13 +0000 (13:20 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 17 Jul 2003 13:20:13 +0000 (13:20 +0000)
lib/silcutil/silchashtable.c

index ac0be772f95f8bc0e7a21a6eb026b2a921bb17a8..6478382a94e51e19eadfe4d6ae261aafa1cceca9 100644 (file)
@@ -369,8 +369,10 @@ SilcHashTable silc_hash_table_alloc(SilcUInt32 table_size,
                                                                 &size_index) :
                          primesize[SILC_HASH_TABLE_SIZE],
                          sizeof(*ht->table));
-  if (!ht->table)
+  if (!ht->table) {
+    silc_free(ht);
     return NULL;
+  }
   ht->table_size = size_index;
   ht->hash = hash;
   ht->compare = compare;