Skip to content

Commit

Permalink
Fix coverity-1596616
Browse files Browse the repository at this point in the history
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 #24263)
  • Loading branch information
nhorman authored and t8m committed Apr 26, 2024
1 parent bde66e8 commit badda78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/hashtable/hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit badda78

Please sign in to comment.