From 3ebb0225c82948bbe271c619b420bca2551f5b6b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 18 Nov 2024 18:34:58 +0100 Subject: [PATCH] fix memory leak #2216, dev.9 --- CHANGELOG_LATEST.md | 4 ++++ src/version.h | 2 +- src/web/WebAPIService.cpp | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 73df2fa9c..c5feb0dd1 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -12,6 +12,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/). - Bosch CS6800i AW - Silent Mode + Electrical Power Reduction (HP) [#2147](https://github.com/emsesp/EMS-ESP32/issues/2147) - `/api/system/showeralert` and `/api/system/showertimer` [#2182](https://github.com/emsesp/EMS-ESP32/issues/2182) - MX400 [#2198](https://github.com/emsesp/EMS-ESP32/issues/2198) +- SM200 values [#2212](https://github.com/emsesp/EMS-ESP32/discussions/2212) ## Fixed @@ -24,5 +25,8 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/). - reading too many telegram parts - heatpump cost UOMs [#2188](https://github.com/emsesp/EMS-ESP32/issues/2188) - analog dac output and inputs on dac pins [#2201](https://github.com/emsesp/EMS-ESP32/discussions/2201) +- api memory leak [#2216](https://github.com/emsesp/EMS-ESP32/issues/2216) ## Changed + +- name of wwstarts2 [#2217](https://github.com/emsesp/EMS-ESP32/discussions/2217) diff --git a/src/version.h b/src/version.h index 5881f12e7..ab1a68da8 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.1-dev.8" \ No newline at end of file +#define EMSESP_APP_VERSION "3.7.1-dev.9" \ No newline at end of file diff --git a/src/web/WebAPIService.cpp b/src/web/WebAPIService.cpp index 4dd87e2b3..17f01b0e7 100644 --- a/src/web/WebAPIService.cpp +++ b/src/web/WebAPIService.cpp @@ -32,13 +32,12 @@ WebAPIService::WebAPIService(AsyncWebServer * server, SecurityManager * security // POST|GET api/{device} // POST|GET api/{device}/{entity} void WebAPIService::webAPIService(AsyncWebServerRequest * request, JsonVariant json) { + JsonDocument input_doc; // has no body JSON so create dummy as empty input object JsonObject input; // if no body then treat it as a secure GET if ((request->method() == HTTP_GET) || (!json.is())) { // HTTP GET - JsonDocument input_doc; // has no body JSON so create dummy as empty input object input = input_doc.to(); - } else { // HTTP_POST input = json.as(); // extract values from the json. these will be used as default values