Mail Archives: djgpp/1997/01/09/08:31:00
> If argument for FREE eq NULL you get the problem. :-(
It is so on some old or broken implementations. ANSI C standard
states that free(NULL) does nothing, and djgpp follows it.
> Instead XFREE correctly process NULL value. The problem
> is what you need xmalloc (i think so) for allocating memory
> to be freeing by xfree. Am i right ?
No, xmalloc is just a wrapper for malloc which checks malloc
return value for NULL, and if it is prints a message and calls
abort(). So it returns a the same pointer as if it was plain
malloc, but it can't be NULL. Thus you can safely free it with
free().
- Raw text -