From b4c119915bb720f6488d485a194cab84e7efe3db Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 30 Mar 2017 21:49:57 +0300 Subject: [PATCH] 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. --- server/core/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/buffer.c b/server/core/buffer.c index ddf3e24bf..cb10df951 100644 --- a/server/core/buffer.c +++ b/server/core/buffer.c @@ -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; }