Potential memory leak in g_realloc, gtk 1.0.6



Hi,

Sorry if this has already been reported a thousand times or already has
been fixed in the gtk development versions.

What I've seen is: inside g_realloc (glib/mem.c), NULL is returned if
the size to allocate equals zero.

This is IMHO a potential memory leak for application programmers that
assume g_realloc will actually perform a free when realloc is called
with a zero size and a non-zero ptr.

If this is intended, I'd like to understand why as I fail to see any
reasons to this behavior.

Cheers,
Koen D'Hondt.
-- 
XmHTML author and maintainer
ripley@xs4all.nl                          http://www.xs4all.nl/~ripley



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]