Memory leak in ev.c
Marc Lehmann
schmorp at schmorp.de
Wed Feb 20 18:01:14 CET 2013
On Wed, Feb 20, 2013 at 04:42:54PM +0100, Alexander Klauer <Alexander.Klauer at itwm.fraunhofer.de> wrote:
> #define ev_free(ptr) ev_realloc ((ptr), 0)
>
> This causes a memory leak on systems where zero-sized objects are
Only if the user-supplied allocator is buggy - the default implementation
calls free.
> #define ev_free(ptr) free ((ptr))
That would be a bug - there is no reason to believe that the user-supplied
allocator is compatible with free.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
-=====/_/_//_/\_,_/ /_/\_\
More information about the libev
mailing list