X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fmessage-file.c;h=197ab0143f18e029cdd3b8858ce087fde507c3a4;hp=75caba6d8b055e5c3b57b2d72d1926381ff11fc8;hb=dc5a9d8eb2c3d120fb9bf8fa9f0f22764a169b77;hpb=146549321044615d9aef2b30cedccda9c49f3f38 diff --git a/lib/message-file.c b/lib/message-file.c index 75caba6d..197ab014 100644 --- a/lib/message-file.c +++ b/lib/message-file.c @@ -238,7 +238,7 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, return decoded_value; if (message->parsing_finished) - return NULL; + return ""; #define NEXT_HEADER_LINE(closure) \ while (1) { \ @@ -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; @@ -348,5 +353,5 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, header_desired); } - return NULL; + return ""; }