From dc5a9d8eb2c3d120fb9bf8fa9f0f22764a169b77 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Tue, 17 Nov 2009 21:28:37 +0600 Subject: [PATCH] Close message file after parsing message headers Keeping unused files open helps to see "Too many open files" often. Signed-off-by: Mikhail Gusarov --- lib/message-file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/message-file.c b/lib/message-file.c index 8a3f8ee0..197ab014 100644 --- a/lib/message-file.c +++ b/lib/message-file.c @@ -325,6 +325,11 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, return decoded_value; } + if (message->parsing_finished) { + fclose (message->file); + message->file = NULL; + } + if (message->line) free (message->line); message->line = NULL;