Skip to content

Commit c6eb58b

Browse files
pks-tgitster
authored andcommitted
config: fix leaking "core.notesref" variable
The variable used to track the "core.notesref" config is not getting freed before we assign to it and thus leaks. Fix this. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f46ede6 commit c6eb58b

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,7 @@ static int git_default_core_config(const char *var, const char *value,
15651565
if (!strcmp(var, "core.notesref")) {
15661566
if (!value)
15671567
return config_error_nonbool(var);
1568+
free(notes_ref_name);
15681569
notes_ref_name = xstrdup(value);
15691570
return 0;
15701571
}

t/t3308-notes-merge.sh

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

66
test_description='Test merging of notes trees'
77

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

1011
test_expect_success setup '

t/t3309-notes-merge-auto-resolve.sh

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

66
test_description='Test notes merging with auto-resolving strategies'
77

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

1011
# Set up a notes merge scenario with all kinds of potential conflicts

0 commit comments

Comments
 (0)