From: Timo Sirainen Date: Wed, 22 Sep 2010 17:11:03 +0000 (+0100) Subject: dict-file: Don't leak fd on deinit. X-Git-Tag: 2.0.4~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=add4be35a949fcfa67da15faf64ee0e8c163e648;p=thirdparty%2Fdovecot%2Fcore.git dict-file: Don't leak fd on deinit. --- diff --git a/src/lib-dict/dict-file.c b/src/lib-dict/dict-file.c index 9bcf4854e6..134376d5ee 100644 --- a/src/lib-dict/dict-file.c +++ b/src/lib-dict/dict-file.c @@ -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);