Allow NULL for some _free routines.
Based on the description in https://github.com/openssl/openssl/pull/5757,
this re-implements the "allow NULL to be passed" behavior of a number of
xxx_free routines. I also fixed up some egregious formatting errors
that were nearby.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5761)
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index 5a465e3..b2b3427 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -225,6 +225,8 @@
{
int i;
+ if (c == NULL)
+ return;
CRYPTO_DOWN_REF(&c->references, &i, c->lock);
REF_PRINT_COUNT("CERT", c);
if (i > 0)