]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-file: Don't leak fd on deinit.
authorTimo Sirainen <tss@iki.fi>
Wed, 22 Sep 2010 17:11:03 +0000 (18:11 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 22 Sep 2010 17:11:03 +0000 (18:11 +0100)
src/lib-dict/dict-file.c

index 9bcf4854e6b9f15e5dae30f4491f853359839d60..134376d5eeec648b997f968ff2fc66e814562697 100644 (file)
@@ -89,6 +89,10 @@ static void file_dict_deinit(struct dict *_dict)
 {
        struct file_dict *dict = (struct file_dict *)_dict;
 
+       if (dict->fd != -1) {
+               if (close(dict->fd) < 0)
+                       i_error("close(%s) failed: %m", dict->path);
+       }
        hash_table_destroy(&dict->hash);
        pool_unref(&dict->hash_pool);
        i_free(dict->path);