Merge pull request #3662 from embhorn/gh3659

Check method for NULL
This commit is contained in:
toddouska 2021-01-21 15:50:58 -08:00 committed by GitHub
commit e9e96dff6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -2414,9 +2414,11 @@ 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");
if (method != NULL) {
ctx = wolfSSL_CTX_new(method(NULL));
if (ctx == NULL)
err_sys("unable to get ctx");
}
#endif
if (simulateWantWrite)

View File

@ -1729,7 +1729,9 @@ 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));
if (method != NULL) {
ctx = SSL_CTX_new(method(NULL));
}
#endif /* WOLFSSL_STATIC_MEMORY */
if (ctx == NULL)
err_sys_ex(catastrophic, "unable to get ctx");