The `html_path` variable gets populated via `git_help_config()`, which
puts an allocated string into it if its value has been configured. We do
not clear the old value though, which causes a memory leak in case the
config exists multiple times.
Plug this leak. The leak is exposed by t0012, but plugging it alone is
not sufficient to make the test suite pass.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
HELP_ACTION_CONFIG_SECTIONS_FOR_COMPLETION,
} cmd_mode;
-static const char *html_path;
+static char *html_path;
static int verbose = 1;
static enum help_format help_format = HELP_FORMAT_NONE;
static int exclude_guides;
if (!strcmp(var, "help.htmlpath")) {
if (!value)
return config_error_nonbool(var);
+ free(html_path);
html_path = xstrdup(value);
return 0;
}