]> git.ipfire.org Git - thirdparty/git.git/commit - revision.c
revisions API: call diff_free(&revs->pruning) in revisions_release()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 13 Apr 2022 20:01:53 +0000 (22:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Apr 2022 06:56:10 +0000 (23:56 -0700)
commit6ab75ac83926c154a58104ac832363f128f8ed56
tree25e1bf50641cb6d0723e93a1f316843d32145434
parent81ffbf838070bf68970688e4a11399f58c562cce
revisions API: call diff_free(&revs->pruning) in revisions_release()

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>
builtin/diff-index.c
builtin/diff.c
revision.c
t/t1001-read-tree-m-2way.sh
t/t1002-read-tree-m-u-2way.sh
t/t2200-add-update.sh
t/t4039-diff-assume-unchanged.sh
t/t4206-log-follow-harder-copies.sh
t/t6131-pathspec-icase.sh