aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-06-04 11:46:10 -0700
committerJunio C Hamano <gitster@pobox.com>2024-06-04 11:48:20 -0700
commit56f4f4a29d32e177ef9af0907a17e431e8b3737e (patch)
tree4586bb0ddaaec7f92dea2eaf09cda010ef1a90d4
parentb25ec8b8d58e73c4327b0fcc9298e7ef6fe8e7a7 (diff)
downloadgit-56f4f4a29d32e177ef9af0907a17e431e8b3737e.tar.xz
imap-send: minimum leakfix
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>
-rw-r--r--imap-send.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c
index c0130d0e02..fb2506dbef 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -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;
}