From bd65afdb21942676e7e4ce77adaaec697624b65f Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 21 Nov 2019 06:55:50 +1000 Subject: [PATCH] Core: allow NULL argument to stored_namemap_free(). Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10488) --- crypto/core_namemap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 = { -- 2.25.1