From c93c6c9bf40ccc3f9b3097eeac2b89f13e2b9e36 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 16 Oct 2015 14:12:38 -0700 Subject: [PATCH] add wolfSSL_new() pointer return check on all calls in example client --- examples/client/client.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/client/client.c b/examples/client/client.c index 1f3e24ef1..dc4a80f0a 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -143,6 +143,8 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, for (i = 0; i < times; i++) { SOCKET_T sockfd; WOLFSSL* ssl = wolfSSL_new(ctx); + if (ssl == NULL) + err_sys("unable to get SSL object"); tcp_connect(&sockfd, host, port, doDTLS, ssl); @@ -181,6 +183,8 @@ int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port, start = current_time(); ssl = wolfSSL_new(ctx); + if (ssl == NULL) + err_sys("unable to get SSL object"); tcp_connect(&sockfd, host, port, doDTLS, ssl); wolfSSL_set_fd(ssl, sockfd); if (wolfSSL_connect(ssl) == SSL_SUCCESS) { @@ -1101,6 +1105,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (resumeSession) { session = wolfSSL_get_session(ssl); sslResume = wolfSSL_new(ctx); + if (sslResume == NULL) + err_sys("unable to get SSL object"); } #endif