]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix coverity-1596616
authorNeil Horman <nhorman@openssl.org>
Thu, 25 Apr 2024 12:41:30 +0000 (08:41 -0400)
committerTomas Mraz <tomas@openssl.org>
Fri, 26 Apr 2024 15:09:06 +0000 (17:09 +0200)
Need to add a null check prior to derefencing pointer for free

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24263)

crypto/hashtable/hashtable.c

index b582ef71afacc50fa7e7e8ee4eadb5dbd0fc5bea..dace86e13f7eb46966da3805339a7d36832bdd37 100644 (file)
@@ -230,7 +230,8 @@ HT *ossl_ht_new(HT_CONFIG *conf)
 err:
     CRYPTO_THREAD_lock_free(new->atomic_lock);
     ossl_rcu_lock_free(new->lock);
-    OPENSSL_free(new->md->neighborhood_ptr_to_free);
+    if (new->md != NULL)
+        OPENSSL_free(new->md->neighborhood_ptr_to_free);
     OPENSSL_free(new->md);
     OPENSSL_free(new);
     return NULL;