aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-11 11:20:38 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-11 13:15:07 -0700
commitc6eb58bfb19a0840841934b91613ea53f0da8651 (patch)
tree37e3c4304e8b4b9e140fce4b3bbe4911fb42f061 /config.c
parentf46ede661face3c57f31097960c00325cf21f67f (diff)
downloadgit-c6eb58bfb19a0840841934b91613ea53f0da8651.tar.gz
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>
Diffstat (limited to 'config.c')
-rw-r--r--config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/config.c b/config.c
index abce05b774..742175c130 100644
--- a/config.c
+++ b/config.c
@@ -1565,6 +1565,7 @@ static int git_default_core_config(const char *var, const char *value,
if (!strcmp(var, "core.notesref")) {
if (!value)
return config_error_nonbool(var);
+ free(notes_ref_name);
notes_ref_name = xstrdup(value);
return 0;
}