mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
Fix that pbuf_realloc() called mem_trim() for "custom" PBUF_RAM
This commit is contained in:
parent
767d0d9046
commit
76e785dd5e
@ -476,7 +476,11 @@ pbuf_realloc(struct pbuf *p, u16_t new_len)
|
||||
|
||||
/* shrink allocated memory for PBUF_RAM */
|
||||
/* (other types merely adjust their length fields */
|
||||
if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
|
||||
if ((q->type == PBUF_RAM) && (rem_len != q->len)
|
||||
#if LWIP_SUPPORT_CUSTOM_PBUF
|
||||
&& ((q->flags & PBUF_FLAG_IS_CUSTOM) == 0)
|
||||
#endif /* LWIP_SUPPORT_CUSTOM_PBUF */
|
||||
) {
|
||||
/* reallocate and adjust the length of the pbuf that will be split */
|
||||
q = (struct pbuf *)mem_trim(q, (u16_t)((u8_t *)q->payload - (u8_t *)q) + rem_len);
|
||||
LWIP_ASSERT("mem_trim returned q == NULL", q != NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user