revision API: call graph_clear() in release_revisions()
Call graph_clear() in release_revisions(), this will free memory allocated by e.g. this command, which will now run without memory leaks: git -P log -1 --graph --no-graph --graph Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
parent
e84a26e32f
commit
fc47252d5b
@ -3020,6 +3020,7 @@ void release_revisions(struct rev_info *revs)
|
||||
date_mode_release(&revs->date_mode);
|
||||
release_revisions_mailmap(revs->mailmap);
|
||||
free_grep_patterns(&revs->grep_filter);
|
||||
graph_clear(revs->graph);
|
||||
/* TODO (need to handle "no_free"): diff_free(&revs->diffopt) */
|
||||
diff_free(&revs->pruning);
|
||||
reflog_walk_info_release(revs->reflog_info);
|
||||
|
@ -5,6 +5,7 @@ test_description='git rebase with its hook(s)'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
|
@ -8,6 +8,7 @@ test_description='test --stat output of various commands'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-terminal.sh
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user