Skip to content

Commit 528605e

Browse files
committed
Merge branch 'bugfix/fix_crash_when_heap_leaks' into 'release/v2.1'
lfix pbuf_free when DRAM lacks See merge request sdk/ESP8266_RTOS_SDK!1161
2 parents 793a629 + 36e4c59 commit 528605e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/liblwip.a

40 Bytes
Binary file not shown.

third_party/lwip/core/pbuf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
303303
(PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 );
304304
/* set reference count (needed here in case we fail) */
305305
p->ref = 1;
306+
p->eb = NULL;
306307

307308
/* now allocate the tail of the pbuf chain */
308309

@@ -337,6 +338,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
337338
((u8_t*)p->payload + p->len <=
338339
(u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED));
339340
q->ref = 1;
341+
q->eb = NULL;
340342
/* calculate remaining length to be allocated */
341343
rem_len -= q->len;
342344
/* remember this pbuf for linkage in next iteration */
@@ -382,6 +384,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
382384
p->len = p->tot_len = length;
383385
p->next = NULL;
384386
p->type = type;
387+
p->eb = NULL;
385388
break;
386389
default:
387390
LWIP_ASSERT("pbuf_alloc: erroneous type", 0);

0 commit comments

Comments
 (0)