Skip to content

Commit ad067ce

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cores/esp8266/LwipIntfDev.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,11 @@ 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+
netif_remove(&_netif);
354+
_started = false;
355+
RawDev::end();
356+
}
355357
}
356358

357359
template<class RawDev>

0 commit comments

Comments
 (0)