diff options
author | Pauli <pauli@openssl.org> | 2022-07-21 12:46:27 +1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-07-22 14:42:13 +0200 |
commit | 93429fc0ce9468242a463ff5878cd53b97e7f13f (patch) | |
tree | 11f13215e9ad68768f13f6c7594a5bfd1c48691c /crypto | |
parent | d50e0934e5b1537db0ea43986464b8f8f8b4e9fd (diff) |
Coverity 1507376: Dereference after null check
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18837)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/sparse_array.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/sparse_array.c b/crypto/sparse_array.c index 53e6e7d460..bbbc9cdb36 100644 --- a/crypto/sparse_array.c +++ b/crypto/sparse_array.c @@ -109,8 +109,10 @@ static void sa_free_leaf(ossl_uintmax_t n, void *p, void *arg) void ossl_sa_free(OPENSSL_SA *sa) { - sa_doall(sa, &sa_free_node, NULL, NULL); - OPENSSL_free(sa); + if (sa != NULL) { + sa_doall(sa, &sa_free_node, NULL, NULL); + OPENSSL_free(sa); + } } void ossl_sa_free_leaves(OPENSSL_SA *sa) |