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,6 +139,8 @@ 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 */
|
||||||
|
if (instance)
|
||||||
|
{
|
||||||
freerdp_abort_connect_context(instance->context);
|
freerdp_abort_connect_context(instance->context);
|
||||||
|
|
||||||
if (!freerdp_shall_disconnect_context(instance->context))
|
if (!freerdp_shall_disconnect_context(instance->context))
|
||||||
@ -146,6 +150,7 @@ static int testAbort(int port)
|
|||||||
s_sync = NULL;
|
s_sync = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
status = WaitForSingleObject(thread, 20000);
|
status = WaitForSingleObject(thread, 20000);
|
||||||
end = GetTickCount();
|
end = GetTickCount();
|
||||||
|
Loading…
Reference in New Issue
Block a user