Skip to content

Commit 2266bb4

Browse files
pks-tgitster
authored andcommitted
builtin/submodule--helper: fix leaking error buffer
Fix leaking error buffer when `compute_alternate_path()` fails. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8f786a8 commit 2266bb4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

builtin/submodule--helper.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,8 @@ static int add_possible_reference_from_superproject(
16211621
; /* nothing */
16221622
}
16231623
}
1624+
1625+
strbuf_release(&err);
16241626
strbuf_release(&sb);
16251627
}
16261628

t/t7408-submodule-reference.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#
55

66
test_description='test clone --reference'
7+
8+
TEST_PASSES_SANITIZE_LEAK=true
79
. ./test-lib.sh
810

911
base_dir=$(pwd)

0 commit comments

Comments
 (0)