fix bug associated with dangling pointer
This commit is contained in:
parent
0b334a8ade
commit
beb3ff9a62
@ -40,7 +40,10 @@ void OTASettingsService::writeToJsonObject(JsonObject& root) {
|
||||
}
|
||||
|
||||
void OTASettingsService::configureArduinoOTA() {
|
||||
delete _arduinoOTA;
|
||||
if (_arduinoOTA){
|
||||
delete _arduinoOTA;
|
||||
_arduinoOTA = NULL;
|
||||
}
|
||||
if (_enabled) {
|
||||
_arduinoOTA = new ArduinoOTAClass;
|
||||
_arduinoOTA->setPort(_port);
|
||||
|
Loading…
Reference in New Issue
Block a user