Memory leak in ev.c

Alexander Klauer Alexander.Klauer at itwm.fraunhofer.de
Wed Feb 20 16:50:33 CET 2013


Hi,

On 02/20/2013 04:42 PM, Alexander Klauer wrote:
>
> in ev.c, there is the definition
>
> #define ev_free(ptr)    ev_realloc ((ptr), 0)
>
> This causes a memory leak on systems where zero-sized objects are 
> being kept track of. Therefore, I suggest this definition to be 
> changed to
>
> #define ev_free(ptr)    free ((ptr))
>

alternatively, one might also change ev_realloc_emul() in the same file 
to keep only the #else part of the #ifdef __GLIBC__. This might be the 
better solution if there are non-standard systems out there which do not 
properly implement free(0).

Best regards,
Alexander



More information about the libev mailing list