[BusyBox] bug#1223: BusyBox] bug#1223: grep segfaults with multiple regexps and CLEAN_UP enabled

Neal H Walfield neal at cs.uml.edu
Mon Nov 19 03:45:03 UTC 2001


> One thing to be aware of is if you compiled it with dmalloc then its a
> fatal error to free a NULL pointer.
>
> If this is the problem you can surround the free statement with an if.
> i.e.
>
> if (ptr) {
> 	free(ptr);
> }
>
> increases binary size though, dmalloc can be recompiled to only give a
> warning.

This is wrong.  According to SUSv2:

        The free() function causes the space pointed to by ptr to be
        deallocated; that is, made available for further
        allocation. If ptr is a null pointer, no action occurs.

dmalloc should be fixed to conform to the standard behavior.






More information about the busybox mailing list