Skip to content

Commit fc47252

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent e84a26e commit fc47252

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

revision.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,6 +3020,7 @@ void release_revisions(struct rev_info *revs)
30203020
date_mode_release(&revs->date_mode);
30213021
release_revisions_mailmap(revs->mailmap);
30223022
free_grep_patterns(&revs->grep_filter);
3023+
graph_clear(revs->graph);
30233024
/* TODO (need to handle "no_free"): diff_free(&revs->diffopt) */
30243025
diff_free(&revs->pruning);
30253026
reflog_walk_info_release(revs->reflog_info);

t/t3413-rebase-hook.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test_description='git rebase with its hook(s)'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./test-lib.sh
910

1011
test_expect_success setup '

t/t4052-stat-output.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ test_description='test --stat output of various commands'
88
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
99
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010

11+
TEST_PASSES_SANITIZE_LEAK=true
1112
. ./test-lib.sh
1213
. "$TEST_DIRECTORY"/lib-terminal.sh
1314

0 commit comments

Comments
 (0)