diff options
author | Pauli <paul.dale@oracle.com> | 2019-11-20 21:55:50 +0100 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-11-21 23:18:42 +0100 |
commit | bd65afdb21942676e7e4ce77adaaec697624b65f (patch) | |
tree | 35d477d9b69f68c4890912644224a153fa79f053 /crypto/core_namemap.c | |
parent | Documentation updates due to naming tweaks (diff) | |
download | openssl-bd65afdb21942676e7e4ce77adaaec697624b65f.tar.xz openssl-bd65afdb21942676e7e4ce77adaaec697624b65f.zip |
Core: allow NULL argument to stored_namemap_free().
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10488)
Diffstat (limited to 'crypto/core_namemap.c')
-rw-r--r-- | crypto/core_namemap.c | 8 |
1 files 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 = { |