diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 1442f243..c176adbe 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -307,7 +307,8 @@ pbuf_realloc(struct pbuf *p, u16_t new_len) /* (other types merely adjust their length fields */ if ((q->type == PBUF_RAM) && (rem_len != q->len)) { /* reallocate and adjust the length of the pbuf that will be split */ - mem_realloc(q, (u8_t *)q->payload - (u8_t *)q + rem_len); + q = mem_realloc(q, (u8_t *)q->payload - (u8_t *)q + rem_len); + LWIP_ASSERT("mem_realloc give q == NULL", q != NULL); } /* adjust length fields for new last pbuf */ q->len = rem_len;