From: Neil Horman Date: Thu, 25 Apr 2024 12:41:30 +0000 (-0400) Subject: Fix coverity-1596616 X-Git-Tag: openssl-3.4.0-alpha1~628 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=badda78325dd961fa41a107796f2744ffbe8b265;p=thirdparty%2Fopenssl.git Fix coverity-1596616 Need to add a null check prior to derefencing pointer for free Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24263) --- diff --git a/crypto/hashtable/hashtable.c b/crypto/hashtable/hashtable.c index b582ef71afa..dace86e13f7 100644 --- a/crypto/hashtable/hashtable.c +++ b/crypto/hashtable/hashtable.c @@ -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;