mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[core,test] Fix TestConnect use after free
This commit is contained in:
parent
5ecd62a5f7
commit
f42f8c32fd
@ -57,6 +57,8 @@ static int runInstance(int argc, char* argv[], freerdp** inst, DWORD timeout)
|
|||||||
rc = 0;
|
rc = 0;
|
||||||
finish:
|
finish:
|
||||||
freerdp_client_context_free(context);
|
freerdp_client_context_free(context);
|
||||||
|
if (inst)
|
||||||
|
*inst = NULL;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,14 +139,17 @@ static int testAbort(int port)
|
|||||||
|
|
||||||
WaitForSingleObject(s_sync, INFINITE);
|
WaitForSingleObject(s_sync, INFINITE);
|
||||||
Sleep(100); /* Wait until freerdp_connect has been called */
|
Sleep(100); /* Wait until freerdp_connect has been called */
|
||||||
freerdp_abort_connect_context(instance->context);
|
if (instance)
|
||||||
|
|
||||||
if (!freerdp_shall_disconnect_context(instance->context))
|
|
||||||
{
|
{
|
||||||
CloseHandle(s_sync);
|
freerdp_abort_connect_context(instance->context);
|
||||||
CloseHandle(thread);
|
|
||||||
s_sync = NULL;
|
if (!freerdp_shall_disconnect_context(instance->context))
|
||||||
return -1;
|
{
|
||||||
|
CloseHandle(s_sync);
|
||||||
|
CloseHandle(thread);
|
||||||
|
s_sync = NULL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = WaitForSingleObject(thread, 20000);
|
status = WaitForSingleObject(thread, 20000);
|
||||||
|
Loading…
Reference in New Issue
Block a user