Skip to content

Commit 6bc793c

Browse files
Fix 60 byte DHCP leak per ::begin
LWIP DHCP needs a separate _cleanup call to free the preallocated DHCP packet PBUF or it will leak 60 bytes every <Ethernet>::end. Add the call on LwipIntfDev::end
1 parent b832dee commit 6bc793c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/lwIP_Ethernet/src/LwipIntfDev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ void LwipIntfDev<RawDev>::end() {
463463
if (_started) {
464464
if (_isDHCP) {
465465
dhcp_stop(&_netif);
466+
dhcp_cleanup(&_netif);
466467
}
467468
if (_intrPin < 0) {
468469
__removeEthernetPacketHandler(_phID);

0 commit comments

Comments
 (0)