From: Pauli Date: Wed, 20 Nov 2019 20:55:50 +0000 (+1000) Subject: Core: allow NULL argument to stored_namemap_free(). X-Git-Tag: openssl-3.0.0-alpha1~921 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bd65afdb21942676e7e4ce77adaaec697624b65f;p=oweals%2Fopenssl.git Core: allow NULL argument to stored_namemap_free(). Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10488) --- diff --git a/crypto/core_namemap.c b/crypto/core_namemap.c index e5a17272d8..9b19d60db3 100644 --- a/crypto/core_namemap.c +++ b/crypto/core_namemap.c @@ -72,9 +72,11 @@ static void stored_namemap_free(void *vnamemap) { OSSL_NAMEMAP *namemap = vnamemap; - /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */ - namemap->stored = 0; - ossl_namemap_free(namemap); + if (namemap != NULL) { + /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */ + namemap->stored = 0; + ossl_namemap_free(namemap); + } } static const OPENSSL_CTX_METHOD stored_namemap_method = {