]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
fixing a leak in the hashtables, htdel didn't delete the hash_node_t entries
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 14:12:16 +0000 (15:12 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 14:12:16 +0000 (15:12 +0100)
util.c

diff --git a/util.c b/util.c
index 1bbbf96f21c701addd162498dc93633f9ff35deb..6853393e0487f384dfe602d331db5027b345a785 100644 (file)
--- a/util.c
+++ b/util.c
@@ -640,12 +640,15 @@ void util_htdel(hash_table_t *ht) {
     size_t i = 0;
     for (; i < ht->size; i++) {
         hash_node_t *n = ht->table[i];
+        hash_node_t *p;
         
         /* free in list */
         while (n) {
             if (n->key)
                 mem_d(n->key);
+            p = n;
             n = n->next;
+            mem_d(p);
         }
         
     }