mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Fix possible segmentation fault or memory corruption if EVIOCGRAB fails and the cleanup is executed before the device entry is inserted into the list
This commit is contained in:
parent
006ad72eb2
commit
a8fd49a234
@ -132,6 +132,9 @@ cleanup:
|
|||||||
{
|
{
|
||||||
struct DeviceEntry *lastEntry;
|
struct DeviceEntry *lastEntry;
|
||||||
|
|
||||||
|
// Lock the device list
|
||||||
|
pthread_mutex_lock(&DeviceListLock);
|
||||||
|
|
||||||
if (DeviceListHead == device) {
|
if (DeviceListHead == device) {
|
||||||
DeviceListHead = device->next;
|
DeviceListHead = device->next;
|
||||||
}
|
}
|
||||||
@ -146,6 +149,9 @@ cleanup:
|
|||||||
lastEntry = lastEntry->next;
|
lastEntry = lastEntry->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unlock device list
|
||||||
|
pthread_mutex_unlock(&DeviceListLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the context
|
// Free the context
|
||||||
|
Loading…
x
Reference in New Issue
Block a user