Also avoid unnecessary NULL check, free(NULL) is valid.
I did read https://lists.freebsd.org/pipermail/freebsd-net/2004-September/005065.html. But Linux accepts NULL and more and more code just expects this to work. It costs nothing to us, while removing another trip over the porting.