Skip to content

Commit 27272de

Browse files
authored
LwIpIntfDev.end() - check _started to prevent crash (#9173)
1 parent 07feace commit 27272de

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)