aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/upload-archive.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-22 11:17:16 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-22 09:18:03 -0700
commit60289b50d01f0b064b8139031dcd3a0d6dfa96a9 (patch)
tree1d3ec4f2b4618b7ddf19bd1c7d7c8d7326a78252 /builtin/upload-archive.c
parent643c6f576cb7b0a7e2345cd4f8e8d7468fefc483 (diff)
downloadgit-60289b50d01f0b064b8139031dcd3a0d6dfa96a9.tar.gz
pretty: fix memory leaks when parsing pretty formats
When parsing pretty formats from the config we leak the name and user format whenever these are set multiple times. This is because we do not free any already-set value in case there is one. Plugging this leak for the name is trivial. For the user format we need to be a bit more careful, because we may end up assigning a pointer into the allocated region when the string is prefixed with either "format" or "tformat:". In order to make it safe to unconditionally free the user format we thus strdup the stripped string into the field instead of a pointer into the string. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/upload-archive.c')
0 files changed, 0 insertions, 0 deletions