Skip to content

Commit

Permalink
Coverity 1507376: Dereference after null check
Browse files Browse the repository at this point in the history
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #18837)
  • Loading branch information
paulidale authored and t8m committed Jul 22, 2022
1 parent d50e093 commit 93429fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crypto/sparse_array.c
Expand Up @@ -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)
Expand Down

0 comments on commit 93429fc

Please sign in to comment.