Skip to content

Commit

Permalink
Merge pull request #7499 from douzzer/20240502-test_server_loop-doubl…
Browse files Browse the repository at this point in the history
…e-close

20240502-test_server_loop-double-close
  • Loading branch information
philljj authored May 3, 2024
2 parents 51b85ee + 0c1d583 commit d22991b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -7437,8 +7437,8 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_nofail(void* args)
!defined(WOLFSSL_NO_TLS12)
static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
{
SOCKET_T sockfd = 0;
SOCKET_T clientfd = 0;
SOCKET_T sockfd;
SOCKET_T clientfd = -1;
word16 port;

callback_functions* cbf;
Expand Down Expand Up @@ -7601,6 +7601,7 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl); ssl = NULL;
CloseSocket(clientfd);
clientfd = -1;

count++;
}
Expand All @@ -7618,7 +7619,8 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
if (!sharedCtx)
wolfSSL_CTX_free(ctx);

CloseSocket(clientfd);
if (clientfd >= 0)
CloseSocket(clientfd);

#ifdef WOLFSSL_TIRTOS
fdCloseSession(Task_self());
Expand Down

0 comments on commit d22991b

Please sign in to comment.