Fix for NULL buffer past to gwbuf_length

This commit is contained in:
Mark Riddoch
2014-05-28 11:00:50 +01:00
parent d6f0f936ec
commit 509379df70
2 changed files with 22 additions and 6 deletions

View File

@ -284,7 +284,11 @@ unsigned int
gwbuf_length(GWBUF *head)
{
int rval = 0;
CHK_GWBUF(head);
if (head)
{
CHK_GWBUF(head);
}
while (head)
{
rval += GWBUF_LENGTH(head);