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:
Johan Wikman
2017-03-30 21:49:57 +03:00
parent 726610b67d
commit b4c119915b

View File

@ -640,7 +640,7 @@ gwbuf_rtrim(GWBUF *head, unsigned int n_bytes)
if (GWBUF_EMPTY(head))
{
rval = head->next;
gwbuf_free(head);
gwbuf_free_one(head);
}
return rval;
}