summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorJonatan Holmgren <jonatan@jontes.page>2026-02-26 21:53:28 +0100
committerJunio C Hamano <gitster@pobox.com>2026-02-26 13:07:24 -0800
commitcdef6255095251500cc7d08d304072e1e2fa0bbd (patch)
tree084449eadf5366aba494134eb7d17949c676dda5 /contrib/persistent-https
parent65892943750b0c66017389f0233ba5a6a7205165 (diff)
downloadgit-cdef6255095251500cc7d08d304072e1e2fa0bbd.tar.gz
git-cdef6255095251500cc7d08d304072e1e2fa0bbd.zip
git, help: fix memory leaks in alias listing
The list_aliases() function sets the util pointer of each list item to a heap-allocated copy of the alias command value. Two callers failed to free these util pointers: - list_cmds() in git.c collects a string list with STRING_LIST_INIT_DUP and clears it with string_list_clear(&list, 0), which frees the duplicated strings (strdup_strings=1) but not the util pointers. Pass free_util=1 to free them. - list_cmds_by_config() in help.c calls string_list_sort_u(list, 0) to deduplicate the list before processing completion.commands overrides. When duplicate entries are removed, the util pointer of each discarded item is leaked because free_util=0. Pass free_util=1 to free them. Reported-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jonatan Holmgren <jonatan@jontes.page> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions