changeset 12152:7cf2b8b8a720

dict-file: Don't leak fd on deinit.
author Timo Sirainen <tss@iki.fi>
date Wed, 22 Sep 2010 18:11:03 +0100
parents ee91aee81d0d
children 02a9cf90ad02
files src/lib-dict/dict-file.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-dict/dict-file.c	Tue Sep 21 18:15:56 2010 +0100
+++ b/src/lib-dict/dict-file.c	Wed Sep 22 18:11:03 2010 +0100
@@ -89,6 +89,10 @@
 {
 	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);