We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0ed406 commit 5044ed4Copy full SHA for 5044ed4
examples/server/server.c
@@ -3621,11 +3621,13 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
3621
err = SSL_get_error(ssl, 0);
3622
LOG_ERROR("SSL_accept error %d, %s\n", err,
3623
ERR_error_string((unsigned long)err, buffer));
3624
- /* cleanup before exit */
3625
- SSL_free(ssl); ssl = NULL;
3626
- SSL_CTX_free(ctx); ctx = NULL;
3627
- CloseSocket(clientfd);
3628
- CloseSocket(sockfd);
+ if (exitWithRet || !runWithErrors) {
+ /* cleanup before exit */
+ SSL_free(ssl); ssl = NULL;
+ SSL_CTX_free(ctx); ctx = NULL;
+ CloseSocket(clientfd);
3629
+ CloseSocket(sockfd);
3630
+ }
3631
if (!exitWithRet) {
3632
err_sys_ex(runWithErrors, "SSL_accept failed");
3633
} else {
0 commit comments