mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Fix heap corruption after packet queue overflow
This commit is contained in:
parent
57031d26e1
commit
5d2d6cc617
@ -105,10 +105,7 @@ static void ReceiveThreadProc(void* context) {
|
||||
memcpy(buffer, &err, sizeof(err));
|
||||
|
||||
err = LbqOfferQueueItem(&packetQueue, buffer);
|
||||
if (err != LBQ_SUCCESS) {
|
||||
free(buffer);
|
||||
}
|
||||
else {
|
||||
if (err == LBQ_SUCCESS) {
|
||||
// The queue owns the buffer now
|
||||
buffer = NULL;
|
||||
}
|
||||
@ -118,6 +115,7 @@ static void ReceiveThreadProc(void* context) {
|
||||
}
|
||||
else if (err == LBQ_INTERRUPTED) {
|
||||
Limelog("Receive thread terminating #2\n");
|
||||
free(buffer);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user