[openssl-project] Removal of NULL checks
Kurt Roeckx
kurt at roeckx.be
Wed Aug 8 17:26:20 UTC 2018
On Wed, Aug 08, 2018 at 08:19:24PM +1000, Tim Hudson wrote:
> We don't have a formal policy of no NULL checks - we just have a few
> members that think we should have such a policy but it has never been voted
> on as we had sufficiently varying views for a consensus approach to not be
> possible.
>
> Personally I'm in favour of high-level APIs having NULL checks as it (in my
> experience) leads to less bogus error crash reports from users and simpler
> handling in error cleanup logic.
> Otherwise you end up writing a whole pile of if(x!=NULL) FOO_free(x); etc
I think at least Rich would not add checks for NULL in functions
that don't expect to be called with NULL, but on the other hand
moves the NULL check into the free() calls. But in that case, we
also clearly document that it can be called with NULL.
So it's at least not general that there shouldn't be a NULL check.
Kurt
More information about the openssl-project
mailing list