[PATCH] stdio: Remove memory leak from multibyte convertion (BZ#25691)
Adhemerval Zanella
adhemerval.zanella@linaro.org
Thu Mar 19 15:59:10 GMT 2020
On 19/03/2020 12:52, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> Both default and wide printf functions might leak memory when
>> manipulate multibyte characters conversion depending of the size
>> of the input (whether __libc_use_alloca trigger or not the fallback
>> heap allocation).
>>
>> This patch fixes it by issuing the required memory free operation
>> and also change the alloca/malloc strategy to a scratch buffer.
>>
>> The testcase uses input argument size that trigger memory leaks
>> on unpatched code, using a scratch buffer the threashold to use
>> heap allocation is lower.
>
> Should we remove the malloc altogether?
>
> I think we already have patches for that.
>
Which malloc exactly (there are still some in printf) and which
patches are you referring ?
More information about the Libc-alpha
mailing list