summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorNeil Horman <nhorman@openssl.org>2024-04-25 08:41:30 -0400
committerTomas Mraz <tomas@openssl.org>2024-04-26 17:09:06 +0200
commitbadda78325dd961fa41a107796f2744ffbe8b265 (patch)
tree61dc425793579da50eb5bf40e5243cfd20fecc9a /crypto
parentbde66e828dd2869d02225e4aab01d0983f242ae3 (diff)
Fix coverity-1596616
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)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/hashtable/hashtable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/hashtable/hashtable.c b/crypto/hashtable/hashtable.c
index b582ef71af..dace86e13f 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;