From 6ab75ac83926c154a58104ac832363f128f8ed56 Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Wed, 13 Apr 2022 22:01:53 +0200 Subject: revisions API: call diff_free(&revs->pruning) in revisions_release() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Call diff_free() on the "pruning" member of "struct rev_info". Doing so makes several tests pass under SANITIZE=leak. This was also the last missing piece that allows us to remove the UNLEAK() in "cmd_diff" and "cmd_diff_index", which allows us to use those commands as a canary for general leaks in the revisions API. See [1] for further rationale, and 886e1084d78 (builtin/: add UNLEAKs, 2017-10-01) for the commit that added the UNLEAK() there. 1. https://lore.kernel.org/git/220218.861r00ib86.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- builtin/diff.c | 1 - 1 file changed, 1 deletion(-) (limited to 'builtin/diff.c') diff --git a/builtin/diff.c b/builtin/diff.c index dd48336da5..f539132ac6 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -594,7 +594,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix) result = diff_result_code(&rev.diffopt, result); if (1 < rev.diffopt.skip_stat_unmatch) refresh_index_quietly(); - UNLEAK(rev); release_revisions(&rev); UNLEAK(ent); UNLEAK(blob); -- cgit v1.2.3