[vlc-devel] [PATCH] Android: implement vlc_strerror and vlc_strerror_c
edward.c.wang at compdigitec.com
Fri Jan 3 15:24:53 CET 2014
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
the buffer must always be allocated by us if the function follows the
Bionic libc declares it as:
extern int strerror_r(int errnum, char *buf, size_t n);
So it appears to follows POSIX rather than the GNU extension, which
means the buffer must be allocated for it.
However, wouldn't using a static buffer not be thread-safe though?
More information about the vlc-devel