[PATCH] stdio: Remove memory leak from multibyte convertion (BZ#25691)
Florian Weimer
fw@deneb.enyo.de
Thu Mar 19 15:52:17 GMT 2020
* 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.
More information about the Libc-alpha
mailing list