Re: [PATCH 08/19] line-log: always allocate the output prefix
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 29, 2024, 19:51 UTC
- Message-ID
- <xmqqr0dkwg4k.fsf@gitster.g>
- In-Reply-To
- <699eeae92c0f58032fc76af68521d8cc60f12031.1716983704.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
> 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.
Yay!
This leak always has bothered me, as it is not just once per process invocation, but once per each commit that is shown.