Fixed leak in TestPipeCreateNamedPipeOverlapped.

This commit is contained in:
Armin Novak 2021-09-20 08:57:08 +02:00 committed by akallabeth
parent aeb2415af9
commit 1ee8370f28

View File

@ -19,7 +19,7 @@ static BYTE CLIENT_MESSAGE[PIPE_BUFFER_SIZE];
static BOOL bClientSuccess = FALSE;
static BOOL bServerSuccess = FALSE;
static HANDLE serverReadyEvent;
static HANDLE serverReadyEvent = NULL;
static LPTSTR lpszPipeName = _T("\\\\.\\pipe\\winpr_test_pipe_overlapped");
@ -332,8 +332,8 @@ finish:
int TestPipeCreateNamedPipeOverlapped(int argc, char* argv[])
{
HANDLE ClientThread;
HANDLE ServerThread;
HANDLE ClientThread = NULL;
HANDLE ServerThread = NULL;
int result = -1;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
@ -372,6 +372,13 @@ int TestPipeCreateNamedPipeOverlapped(int argc, char* argv[])
out:
if (ClientThread)
CloseHandle(ClientThread);
if (ServerThread)
CloseHandle(ServerThread);
if (serverReadyEvent)
CloseHandle(serverReadyEvent);
#ifndef _WIN32
if (result == 0)
{