fix possible memory leaks

This commit is contained in:
MichaelDvP
2026-07-10 09:33:15 +02:00
parent 9443cf3c87
commit 5a1d06d39e
3 changed files with 3 additions and 1 deletions

View File

@@ -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);
} }

View File

@@ -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();

View File

@@ -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;
} }