]> git.ipfire.org Git - thirdparty/git.git/commitdiff
imap-send: minimum leakfix
authorJunio C Hamano <gitster@pobox.com>
Tue, 4 Jun 2024 18:46:10 +0000 (11:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Jun 2024 18:48:20 +0000 (11:48 -0700)
EVen with the minimum "no-op" invocation t1517 makes, "git imap-send"
leaks an empty strbuf it used to read a 0-byte string into.

There are a few other topics cooking in 'next' that plugs many
other leaks in this program, so let's minimally fix this one, barely
enough to make CI pass, leaving the rest for the other topic.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c

index c0130d0e02f8335622081f4166f9841569265105..fb2506dbef92e1a639227f523a369fc0ffbbb729 100644 (file)
@@ -1543,6 +1543,7 @@ int cmd_main(int argc, const char **argv)
        }
 
        if (all_msgs.len == 0) {
+               strbuf_release(&all_msgs);
                fprintf(stderr, "nothing to send\n");
                return 1;
        }