Git fork

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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
c6eb58bf f46ede66

+3
+1
config.c
··· 1565 1565 if (!strcmp(var, "core.notesref")) { 1566 1566 if (!value) 1567 1567 return config_error_nonbool(var); 1568 + free(notes_ref_name); 1568 1569 notes_ref_name = xstrdup(value); 1569 1570 return 0; 1570 1571 }
+1
t/t3308-notes-merge.sh
··· 5 5 6 6 test_description='Test merging of notes trees' 7 7 8 + TEST_PASSES_SANITIZE_LEAK=true 8 9 . ./test-lib.sh 9 10 10 11 test_expect_success setup '
+1
t/t3309-notes-merge-auto-resolve.sh
··· 5 5 6 6 test_description='Test notes merging with auto-resolving strategies' 7 7 8 + TEST_PASSES_SANITIZE_LEAK=true 8 9 . ./test-lib.sh 9 10 10 11 # Set up a notes merge scenario with all kinds of potential conflicts