From f2de3215c3812e777be99702c3cc9e5cca65ca0d Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 20 Jan 2012 21:21:10 +0100 Subject: [PATCH] pbuf_copy(): moved the check for "p_to != NULL" to a better place. --- src/core/pbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index a458b167..1258bb36 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -863,7 +863,6 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from) /* iterate through pbuf chain */ do { - LWIP_ERROR("p_to != NULL", p_to != NULL, return ERR_ARG;); /* copy one part of the original chain */ if ((p_to->len - offset_to) >= (p_from->len - offset_from)) { /* complete current p_from fits into current p_to */ @@ -880,6 +879,7 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from) /* on to next p_to (if any) */ offset_to = 0; p_to = p_to->next; + LWIP_ERROR("p_to != NULL", p_to != NULL, return ERR_ARG;); } LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len); if (offset_from >= p_from->len) {