mailinfo: explicitly close file handle to the patch output
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 Oct 2015 22:35:10 +0000 (15:35 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Oct 2015 05:13:27 +0000 (22:13 -0700)
This does not make a difference within the context of "git mailinfo"
that runs once and exits, as flushing and closing would happen upon
process termination. It however will matter when we eventually make
it callable as an API function.

Besides, cleaning after yourself once you are done is a good hygiene.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mailinfo.c
index 1566c19b6277b464607ddeb6ba0369383a0325ae..73be47c4975c961f2a438ec683e7148ccf2e9a88 100644 (file)
@@ -999,6 +999,8 @@ static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
                check_header(&line, p_hdr_data, 1);
 
        handle_body();
+       fclose(patchfile);
+
        handle_info();
 
        return 0;