]> git.ipfire.org Git - thirdparty/git.git/commitdiff
format-patch: mark rev_info with UNLEAK
authorJunio C Hamano <gitster@pobox.com>
Thu, 16 Dec 2021 23:37:10 +0000 (15:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Dec 2021 01:22:33 +0000 (17:22 -0800)
The comand uses a single instance of rev_info on stack, makes a
single revision traversal and exit.  Mark the resources held by the
rev_info structure with UNLEAK().

We do not do this at lower level in revision.c or cmd_log_walk(), as
a new caller of the revision traversal API can make unbounded number
of rev_info during a single run, and UNLEAK() would not a be
suitable mechanism to deal with such a caller.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c

index f75d87e8d7fea489639a8e38b7a4704bc75ba0cd..a7bca8353ba3f83f69b53257ad1e4b10f5f68493 100644 (file)
@@ -2241,6 +2241,7 @@ done:
        strbuf_release(&rdiff1);
        strbuf_release(&rdiff2);
        strbuf_release(&rdiff_title);
+       UNLEAK(rev);
        return 0;
 }