Skip to content

Commit

Permalink
fix for coverity issue 394676 possible null dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Jul 5, 2024
1 parent d4cf93c commit f8eb0c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ssl_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -5496,7 +5496,7 @@ long wolfSSL_set_tmp_dh(WOLFSSL *ssl, WOLFSSL_DH *dh)
ret = wolfssl_set_tmp_dh(ssl, p, pSz, g, gSz);
}

if (ret != 1) {
if (ret != 1 && ssl != NULL) {
/* Free the allocated buffers if not assigned into SSL. */
XFREE(p, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
XFREE(g, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
Expand Down

0 comments on commit f8eb0c3

Please sign in to comment.