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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
f46ede661f
commit
c6eb58bfb1
1
config.c
1
config.c
|
@ -1565,6 +1565,7 @@ static int git_default_core_config(const char *var, const char *value,
|
||||||
if (!strcmp(var, "core.notesref")) {
|
if (!strcmp(var, "core.notesref")) {
|
||||||
if (!value)
|
if (!value)
|
||||||
return config_error_nonbool(var);
|
return config_error_nonbool(var);
|
||||||
|
free(notes_ref_name);
|
||||||
notes_ref_name = xstrdup(value);
|
notes_ref_name = xstrdup(value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
test_description='Test merging of notes trees'
|
test_description='Test merging of notes trees'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
test_description='Test notes merging with auto-resolving strategies'
|
test_description='Test notes merging with auto-resolving strategies'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
# Set up a notes merge scenario with all kinds of potential conflicts
|
# Set up a notes merge scenario with all kinds of potential conflicts
|
||||||
|
|
Loading…
Reference in New Issue