martin-ger / esp-open-lwip

ESP8266 lwIP library with NAT, SLIP, ENC28j60 Ethernet, and routing support
67 stars 25 forks source link

wifi_set_opmode_current(STATIONAP_MODE) leaking memory #30

Open st0ff3r opened 4 years ago

st0ff3r commented 4 years ago

reposting this:

I found out it was fixed by setting LWIP_HAVE_LOOPIF=0 and LWIP_HAVE_SLIPIF=0 but I had to disable content of lwip/netif/espenc.c in order to get it to compile without errors

using latest sdk 992479e from master branch, it appears that wifi_set_opmode_current(STATIONAP_MODE) is leaking memory:

wifi_set_opmode_current(NULL_MODE);

[...]

if (wifi_get_opmode() != STATIONAP_MODE) { printf("HEAP1=%u\n\r", system_get_free_heap_size()); wifi_set_opmode_current(STATIONAP_MODE); printf("HEAP2=%u\n\r", system_get_free_heap_size()); }

HEAP1=24888 mode : sta(ec:fa:bc:21:27:94) + softAP(ee:fa:bc:21:27:94) 4010b0b0 already freed add if0 add if1 dhcp server start:(ip:10.0.5.1,mask:255.255.255.0,gw:10.0.5.1) bcn 100 3fff7720 already freed HEAP2=21472

st0ff3r commented 4 years ago

fixed by disabling ethernet in pull request #31, commit 2195f9493cff024b1308b7d83a40ec174a0af8d7