[vlc-devel] [PATCH] Android: implement vlc_strerror and vlc_strerror_c

Rémi Denis-Courmont remi at remlab.net
Fri Jan 3 18:21:21 CET 2014


Le vendredi 3 janvier 2014, 09:24:53 Edward Wang a écrit :
> On 2014-01-03 06:10, Rémi Denis-Courmont <remi at remlab.net> wrote:
> >> +const char *vlc_strerror(int errnum)
> >> 
> >> >+{
> >> >+    char* buf = malloc(100);
> > 
> > This looks like a memory leak to me.
> 
> It seems that according to
> http://stackoverflow.com/questions/19640640/what-to-do-with-the-pointer-retu
> rned-by-strerror-r-function the buffer must always be allocated by us if the
> function follows the POSIX standard.

This may well be right even though I don't think stackoverflow.com is a 
trustworthy source of information in general, though it might be right here.
Yet I fail to see how this is relevant to the memory leak or absence thereof.

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




More information about the vlc-devel mailing list