mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-29 01:52:51 +00:00
fix possible memory leaks
This commit is contained in:
@@ -782,8 +782,8 @@ std::string compute(const std::string & expr) {
|
|||||||
expr_new.replace(f, e - f, result.c_str());
|
expr_new.replace(f, e - f, result.c_str());
|
||||||
}
|
}
|
||||||
http->end();
|
http->end();
|
||||||
delete http;
|
|
||||||
}
|
}
|
||||||
|
delete http;
|
||||||
}
|
}
|
||||||
f = expr_new.find_first_of('{', e);
|
f = expr_new.find_first_of('{', e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,6 +401,7 @@ bool WebSchedulerService::command(const char * name, const std::string & command
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// we can add other json tests here
|
// we can add other json tests here
|
||||||
|
delete http;
|
||||||
}
|
}
|
||||||
|
|
||||||
doc.clear();
|
doc.clear();
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json)
|
|||||||
if (!ok) {
|
if (!ok) {
|
||||||
EMSESP::logger().err("Action '%s' failed", action.c_str());
|
EMSESP::logger().err("Action '%s' failed", action.c_str());
|
||||||
request->send(400); // bad request
|
request->send(400); // bad request
|
||||||
|
delete response;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user