From: Matt Caswell Date: Fri, 24 Apr 2020 10:44:15 +0000 (+0100) Subject: Ensure OSSL_PARAM_BLD_free() can accept a NULL X-Git-Tag: openssl-3.0.0-alpha2~91 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a6f8a834ba6f877baa427e3d25694d49beb29306;p=oweals%2Fopenssl.git Ensure OSSL_PARAM_BLD_free() can accept a NULL All OpenSSL free functions should accept NULL. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11635) --- diff --git a/crypto/param_build.c b/crypto/param_build.c index 43b194bcea..76522cd377 100644 --- a/crypto/param_build.c +++ b/crypto/param_build.c @@ -125,6 +125,8 @@ static void free_all_params(OSSL_PARAM_BLD *bld) void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld) { + if (bld == NULL) + return; free_all_params(bld); sk_OSSL_PARAM_BLD_DEF_free(bld->params); OPENSSL_free(bld);