Skip to content

Commit d03c98a

Browse files
committed
LwIpIntfDev.end() - check _started to prevent crash
1 parent c2f1365 commit d03c98a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cores/esp8266/LwipIntfDev.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,12 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
349349
template<class RawDev>
350350
void LwipIntfDev<RawDev>::end()
351351
{
352-
netif_remove(&_netif);
353-
_started = false;
354-
RawDev::end();
352+
if (_started)
353+
{
354+
netif_remove(&_netif);
355+
_started = false;
356+
RawDev::end();
357+
}
355358
}
356359

357360
template<class RawDev>

0 commit comments

Comments
 (0)