mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
tests/api.c: fix double close in test_server_loop().
This commit is contained in:
@ -7437,8 +7437,8 @@ done:
|
|||||||
!defined(WOLFSSL_NO_TLS12)
|
!defined(WOLFSSL_NO_TLS12)
|
||||||
static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
|
static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
|
||||||
{
|
{
|
||||||
SOCKET_T sockfd = 0;
|
SOCKET_T sockfd;
|
||||||
SOCKET_T clientfd = 0;
|
SOCKET_T clientfd = -1;
|
||||||
word16 port;
|
word16 port;
|
||||||
|
|
||||||
callback_functions* cbf;
|
callback_functions* cbf;
|
||||||
@ -7601,6 +7601,7 @@ static THREAD_RETURN WOLFSSL_THREAD test_server_loop(void* args)
|
|||||||
wolfSSL_shutdown(ssl);
|
wolfSSL_shutdown(ssl);
|
||||||
wolfSSL_free(ssl); ssl = NULL;
|
wolfSSL_free(ssl); ssl = NULL;
|
||||||
CloseSocket(clientfd);
|
CloseSocket(clientfd);
|
||||||
|
clientfd = -1;
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -7618,7 +7619,8 @@ done:
|
|||||||
if (!sharedCtx)
|
if (!sharedCtx)
|
||||||
wolfSSL_CTX_free(ctx);
|
wolfSSL_CTX_free(ctx);
|
||||||
|
|
||||||
CloseSocket(clientfd);
|
if (clientfd >= 0)
|
||||||
|
CloseSocket(clientfd);
|
||||||
|
|
||||||
#ifdef WOLFSSL_TIRTOS
|
#ifdef WOLFSSL_TIRTOS
|
||||||
fdCloseSession(Task_self());
|
fdCloseSession(Task_self());
|
||||||
|
Reference in New Issue
Block a user