Check method for NULL

This commit is contained in:
Eric Blankenhorn 2021-01-18 16:18:49 -06:00
parent 563e3c6b60
commit 50843b22cd
2 changed files with 10 additions and 4 deletions

View File

@ -2414,9 +2414,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
err_sys("unable to load static memory");
}
#else
ctx = wolfSSL_CTX_new(method(NULL));
if (ctx == NULL)
err_sys("unable to get ctx");
else {
/* method is not NULL */
ctx = wolfSSL_CTX_new(method(NULL));
if (ctx == NULL)
err_sys("unable to get ctx");
}
#endif
if (simulateWantWrite)

View File

@ -1729,7 +1729,10 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
!= WOLFSSL_SUCCESS)
err_sys_ex(catastrophic, "unable to load static memory and create ctx");
#else
ctx = SSL_CTX_new(method(NULL));
else {
/* method is not NULL */
ctx = SSL_CTX_new(method(NULL));
}
#endif /* WOLFSSL_STATIC_MEMORY */
if (ctx == NULL)
err_sys_ex(catastrophic, "unable to get ctx");