Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> calling free(NULL) is well-defined and safe

Probably showing my age. SunOS 4, PalmOS, and 3BSD reputedly crashed. (There were also double free exploits back in 1996.)

This further illustrates my point, though: Removing the NULL check is a single conditional to remove, as opposed to littering the free + guard everywhere. In effect, by isolating duplicated pieces of logic, it keeps possibilities open.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: