Skip to content

Commit 25d52dd

Browse files
fix coverity issue 367842 possible null dereference
1 parent 50a7243 commit 25d52dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ssl_load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5264,7 +5264,7 @@ int wolfSSL_SetTmpDH(WOLFSSL* ssl, const unsigned char* p, int pSz,
52645264
ret = wolfssl_set_tmp_dh(ssl, pAlloc, pSz, gAlloc, gSz);
52655265
}
52665266

5267-
if (ret != 1) {
5267+
if (ret != 1 && ssl != NULL) {
52685268
/* Free the allocated buffers if not assigned into SSL. */
52695269
XFREE(pAlloc, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);
52705270
XFREE(gAlloc, ssl->heap, DYNAMIC_TYPE_PUBLIC_KEY);

0 commit comments

Comments
 (0)