]> git.ipfire.org Git - thirdparty/git.git/commit
line-log: always allocate the output prefix
authorPatrick Steinhardt <ps@pks.im>
Fri, 7 Jun 2024 06:38:16 +0000 (08:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jun 2024 17:30:51 +0000 (10:30 -0700)
commit394affd46dc9b0c805df6e999837aa297f844fc0
tree6b1e98649783221884f085b775f7346ebcfdd623
parent42d2ad55566013535c16b80fc2d445da93cceed3
line-log: always allocate the output prefix

The returned string by `output_prefix()` is sometimes a string constant
and sometimes an allocated string. This has been fine until now because
we always leak the allocated strings, and thus we never tried to free
the string constant.

Fix the code to always return an allocated string and free the returned
value at all callsites.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
line-log.c