Fixes null dereference bug

Avoids a null function pointer dereference that happened, when
freerdp_urbdrc_client_subsystem_entry failed before invoking
udevman_load_interface.
This commit is contained in:
Lukas Fink 2020-04-24 19:06:24 +02:00 committed by akallabeth
parent 0cbff94aa9
commit 0c27cecea4
1 changed files with 12 additions and 3 deletions

View File

@ -313,6 +313,9 @@ static BOOL udevman_unregister_all_udevices(IUDEVMAN* idevman)
if (!idevman)
return FALSE;
if (!udevman->head)
return TRUE;
idevman->loading_lock(idevman);
idevman->rewind(idevman);
@ -430,11 +433,17 @@ static void udevman_free(IUDEVMAN* idevman)
return;
udevman->running = FALSE;
WaitForSingleObject(udevman->thread, INFINITE);
if (udevman->thread)
{
WaitForSingleObject(udevman->thread, INFINITE);
CloseHandle(udevman->thread);
}
udevman_unregister_all_udevices(idevman);
CloseHandle(udevman->devman_loading);
CloseHandle(udevman->thread);
if (udevman->devman_loading)
CloseHandle(udevman->devman_loading);
libusb_exit(udevman->context);
ArrayList_Free(udevman->hotplug_vid_pids);