(avoid referrencing memory that might have been freed). From FreeBSD (ages ago, just not committed until now...)