* lib/hash.c (hash_rehash): Avoid memory leak.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-06-18 Eric Blake <ebb9@byu.net>
+ hash: fix memory leak in last patch
+ * lib/hash.c (hash_rehash): Avoid memory leak.
+
hash: avoid no-op rehashing
* lib/hash.c (hash_rehash): Recognize useless rehash attempts.
if (new_table == NULL)
return false;
if (new_table->n_buckets == table->n_buckets)
- return true;
+ {
+ free (new_table->bucket);
+ free (new_table);
+ return true;
+ }
/* Merely reuse the extra old space into the new table. */
#if USE_OBSTACK