Skip to content

Commit be0d742

Browse files
JAndrassyhasenradball
authored andcommitted
LwIpIntfDev.end() - check _started to prevent crash (esp8266#9173)
1 parent 35c50be commit be0d742

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cores/esp8266/LwipIntfDev.h

Lines changed: 6 additions & 3 deletions
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)