From fd1a1bd0f77df159cfd080bf27f60afb12b1cbb2 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 23 Jul 2020 14:32:48 -0700 Subject: [PATCH] Add some missing frees to the example client when using in the return-not-exit mode for tests. --- examples/client/client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/client/client.c b/examples/client/client.c index 486508629..fd62cb59f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -3165,12 +3165,16 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err = ClientWrite(ssl, msg, msgSz, "", exitWithRet); if (exitWithRet && (err != 0)) { ((func_args*)args)->return_code = err; + wolfSSL_free(ssl); ssl = NULL; + wolfSSL_CTX_free(ctx); ctx = NULL; goto exit; } err = ClientRead(ssl, reply, sizeof(reply)-1, 1, "", exitWithRet); if (exitWithRet && (err != 0)) { ((func_args*)args)->return_code = err; + wolfSSL_free(ssl); ssl = NULL; + wolfSSL_CTX_free(ctx); ctx = NULL; goto exit; }