]> git.ipfire.org Git - thirdparty/git.git/commit
revisions API: have release_revisions() release "topo_walk_info"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 14 Apr 2022 05:56:39 +0000 (07:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Apr 2022 06:56:10 +0000 (23:56 -0700)
commitae1b383dfa945d98ec3cedd744619c2028d6edf7
treea395531516ec70ab980aae88010c8b8425bd1222
parent9d5a7df3322551422f257c686f6621a22e0fa731
revisions API: have release_revisions() release "topo_walk_info"

Refactor the existing reset_topo_walk() into a thin wrapper for a
release_revisions_topo_walk_info() + resetting the member to "NULL",
and call release_revisions_topo_walk_info() from release_revisions().

This fixes memory leaks that have been with us ever since
"topo_walk_info" was added to revision.[ch] in
f0d9cc4196a (revision.c: begin refactoring --topo-order logic,
2018-11-01).

Due to various other leaks this makes no tests pass in their entirety,
but e.g. before this running this on git.git:

    ./git -P log --pretty=tformat:"%P   %H | %s" --parents --full-history --topo-order -3 -- README.md

Would report under SANITIZE=leak:

    SUMMARY: LeakSanitizer: 531064 byte(s) leaked in 6 allocation(s).

Now we'll free all of that memory.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c