Skip to content

Commit ee6a998

Browse files
pks-tgitster
authored andcommitted
blame: fix leaking data for blame scoreboards
There are some memory leaks when cleaning up blame scoreboards. Fix those. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4b4f5a9 commit ee6a998

9 files changed

+16
-0
lines changed

blame.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,6 +2928,10 @@ void setup_blame_bloom_data(struct blame_scoreboard *sb)
29282928

29292929
void cleanup_scoreboard(struct blame_scoreboard *sb)
29302930
{
2931+
free(sb->lineno);
2932+
clear_prio_queue(&sb->commits);
2933+
oidset_clear(&sb->ignore_list);
2934+
29312935
if (sb->bloom_data) {
29322936
int i;
29332937
for (i = 0; i < sb->bloom_data->nr; i++) {

t/t4061-diff-indent.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ test_description='Test diff indent heuristic.
66
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
77
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
88

9+
TEST_PASSES_SANITIZE_LEAK=true
910
. ./test-lib.sh
1011
. "$TEST_DIRECTORY"/lib-diff.sh
1112

t/t8002-blame.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
55
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
66

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

1011
PROG='git blame -c'

t/t8004-blame-with-conflicts.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ test_description='git blame on conflicted files'
66
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
77
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
88

9+
TEST_PASSES_SANITIZE_LEAK=true
910
. ./test-lib.sh
1011

1112
test_expect_success 'setup first case' '

t/t8006-blame-textconv.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
test_description='git blame textconv support'
4+
5+
TEST_PASSES_SANITIZE_LEAK=true
46
. ./test-lib.sh
57

68
find_blame() {

t/t8009-blame-vs-topicbranches.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
test_description='blaming trough history with topic branches'
4+
5+
TEST_PASSES_SANITIZE_LEAK=true
46
. ./test-lib.sh
57

68
# Creates the history shown below. '*'s mark the first parent in the merges.

t/t8011-blame-split-file.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Note that we need to use "blame -C" to find the commit for all lines. We will
1010
not bother testing that the non-C case fails to find it. That is how blame
1111
behaves now, but it is not a property we want to make sure is retained.
1212
'
13+
14+
TEST_PASSES_SANITIZE_LEAK=true
1315
. ./test-lib.sh
1416

1517
# help avoid typing and reading long strings of similar lines

t/t8012-blame-colors.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
55
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
66

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

1011
PROG='git blame -c'

t/t8014-blame-ignore-fuzzy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
test_description='git blame ignore fuzzy heuristic'
4+
5+
TEST_PASSES_SANITIZE_LEAK=true
46
. ./test-lib.sh
57

68
pick_author='s/^[0-9a-f^]* *(\([^ ]*\) .*/\1/'

0 commit comments

Comments
 (0)