From e6e9170d6e28038768895e1af18e3aad8093bf4b Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Tue, 27 Mar 2018 16:25:08 -0400 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/5761) --- ssl/ssl_cert.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ssl/ssl_cert.c') diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 5a465e3942..b2b342767c 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -225,6 +225,8 @@ void ssl_cert_free(CERT *c) { int i; + if (c == NULL) + return; CRYPTO_DOWN_REF(&c->references, &i, c->lock); REF_PRINT_COUNT("CERT", c); if (i > 0) -- cgit v1.2.3