Fix heap corruption after packet queue overflow
This commit is contained in:
parent
57031d26e1
commit
5d2d6cc617
1 changed files with 2 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue