]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: fix memory leak of iterator in str_table_deinit()
authorPhil Carmody <phil@dovecot.fi>
Mon, 16 Nov 2015 10:29:21 +0000 (12:29 +0200)
committerPhil Carmody <phil@dovecot.fi>
Mon, 16 Nov 2015 10:29:21 +0000 (12:29 +0200)
The deinit function uses an iterator, but never cleared it up. Found by
Valgrind.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
src/lib/str-table.c

index 65ac2df695a006c44be83efa528f0902a3982599..4362cb31435d9b0499fe90b18e0c6448156887c2 100644 (file)
@@ -29,6 +29,7 @@ void str_table_deinit(struct str_table **_table)
        iter = hash_table_iterate_init(table->hash);
        while (hash_table_iterate(iter, table->hash, &key, &value))
                i_free(key);
+       hash_table_iterate_deinit(&iter);
        hash_table_destroy(&table->hash);
        i_free(table);
 }