summaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-04-13 20:01:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-04-14 06:56:09 (GMT)
commitbf1b32d0991cfead7e5604897d0866b789bf602e (patch)
tree44a91cedec57c990c4921c12ac84b0876af60b68 /builtin/diff.c
parentf6bfea0ad0151a941686b2ed1875ec7038623ac0 (diff)
downloadgit-bf1b32d0991cfead7e5604897d0866b789bf602e.zip
git-bf1b32d0991cfead7e5604897d0866b789bf602e.tar.gz
git-bf1b32d0991cfead7e5604897d0866b789bf602e.tar.bz2
revisions API users: use release_revisions() with UNLEAK()
Use a release_revisions() with those "struct rev_list" users which already "UNLEAK" the struct. It may seem odd to simultaneously attempt to free() memory, but also to explicitly ignore whether we have memory leaks in the same. As explained in preceding commits this is being done to use the built-in commands as a guinea pig for whether the release_revisions() function works as expected, we'd like to test e.g. whether we segfault as we change it. In subsequent commits we'll then remove these UNLEAK() as the function is made to free the memory that caused us to add them in the first place. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index bb7fafc..dd48336 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -595,6 +595,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
if (1 < rev.diffopt.skip_stat_unmatch)
refresh_index_quietly();
UNLEAK(rev);
+ release_revisions(&rev);
UNLEAK(ent);
UNLEAK(blob);
return result;