mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
fix for coverity issue 394676 possible null dereference
This commit is contained in:
@ -5496,7 +5496,7 @@ long wolfSSL_set_tmp_dh(WOLFSSL *ssl, WOLFSSL_DH *dh)
|
|||||||
ret = wolfssl_set_tmp_dh(ssl, p, pSz, g, gSz);
|
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. */
|
/* Free the allocated buffers if not assigned into SSL. */
|
||||||
XFREE(p, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
XFREE(p, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
XFREE(g, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
XFREE(g, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
|
Reference in New Issue
Block a user