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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
return -1;
}
result = run_diff_index(&rev, option);
- UNLEAK(rev);
result = diff_result_code(&rev.diffopt, result);
release_revisions(&rev);
return result;
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);
clear_pathspec(&revs->prune_data);
release_revisions_mailmap(revs->mailmap);
free_grep_patterns(&revs->grep_filter);
+ diff_free(&revs->pruning);
reflog_walk_info_release(revs->reflog_info);
}
yomin - not in H or M
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh
'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-read-tree.sh
Also tested are "git add -u" without limiting, and "git add -u"
without contents changes, and other conditions'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
test_description='diff with assume-unchanged entries'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# external diff has been tested in t4020-diff-external.sh
test_description='Test --follow should always find copies hard in git log.
'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-diff.sh
#!/bin/sh
test_description='test case insensitive pathspec limiting'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
if test_have_prereq CASE_INSENSITIVE_FS