NULL-checks before free()

Tony Finch dot at dotat.at
Thu Dec 10 10:23:53 UTC 2015


Michael McConville via Unbound-users <unbound-users at unbound.net> wrote:
>
> POSIX specifies that free() is NULL-safe. All modern and almost all
> prehistoric platforms conform to this, and most codebases already assume
> it.

free() has been NULL-safe since C89. (Allocators were not very standard
before then so I would expect 1980s pre-standard free() to behave
weirdly.)

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
Trafalgar: Easterly 4 or 5, but 6 to gale 8 in southeast. Moderate or rough.
Fair. Moderate or good.



More information about the Unbound-users mailing list