mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-10-21 07:46:53 +00:00
Fix heap corruption after packet queue overflow
This commit is contained in:
1 parent
57031d26e1
commit
5d2d6cc617
1 file changed
+2
-4
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user