Fix gwbuf_rtrim
- If everything in the first buffer of a buffer chain is consumed, then the whole chain and not just the first buffer was freed. NOTE: gwbuf_rtrim needs to be fixed so that it removes data from the tail of a chain and *not* from the end of the first buffer in a chain. That cannot ever be what is wanted.
This commit is contained in:
@ -640,7 +640,7 @@ gwbuf_rtrim(GWBUF *head, unsigned int n_bytes)
|
|||||||
if (GWBUF_EMPTY(head))
|
if (GWBUF_EMPTY(head))
|
||||||
{
|
{
|
||||||
rval = head->next;
|
rval = head->next;
|
||||||
gwbuf_free(head);
|
gwbuf_free_one(head);
|
||||||
}
|
}
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user