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)
This commit is contained in:
Pauli 2022-07-21 12:46:27 +10:00 committed by Tomas Mraz
parent d50e0934e5
commit 93429fc0ce
1 changed files with 4 additions and 2 deletions

View File

@ -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)