Fix debug assertion on readq prepend

If data was prepended to the readq while it was empty, the debug assertion
in gwbuf_append that checks the tail pointer would be hit.
This commit is contained in:
Markus Mäkelä 2019-09-20 09:08:47 +03:00
parent 9ce788ff0b
commit 9b0b152109
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -342,7 +342,7 @@ static unsigned int dcb_readq_length(DCB* dcb)
*/
static inline void dcb_readq_prepend(DCB* dcb, GWBUF* buffer)
{
dcb->readq = gwbuf_append(buffer, dcb->readq);
dcb->readq = dcb->readq ? gwbuf_append(buffer, dcb->readq) : buffer;
}
/**