[vlc-devel] [PATCH] realloc: use realloc_or_free() to avoid memory leak

Rémi Denis-Courmont remi at remlab.net
Wed Dec 10 17:49:38 CET 2014


Le mercredi 10 décembre 2014, 22:17:32 Arjun Sreedharan a écrit :
> On 10 December 2014 at 20:19, Rémi Denis-Courmont <remi at remlab.net> wrote:
> > Le 2014-12-10 17:35, Arjun Sreedharan a écrit :
> >> overwriting pointer with realloc()'s return value can leak memory
> >> when realloc() fails. realloc_or_free() manages this and frees memory
> >> on failure.
> > 
> > Did you actually test this? Some of the snippets don't look right.
> 
> It compiled fine.
> Could you point out what looks wrong to you.

I checked only one snippet and it was introducing a double free() bug rather 
than fixing anything...

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list