From da27fd1ceb367ce655fe46b0e954d2362b8e49ef Mon Sep 17 00:00:00 2001 From: s3lph Date: Sat, 23 Nov 2024 00:54:36 +0100 Subject: [PATCH] fix: memory leak due to wrong usage of arduinojson --- esp32/src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 92de5f3..f51fc54 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -32,7 +32,7 @@ WiFiUDP wifiUdp; NTP ntp(wifiUdp); Adafruit_NeoPixel pixels(WS2812_LEN, WS2812_PIN, NEO_RGB | NEO_KHZ800); -JsonDocument json, filter; +JsonDocument filter; ESP32Timer ITimer0(0); volatile bool wmp_needs_config_save; @@ -244,6 +244,7 @@ bool updateMap() { // Read until empty line (HTTP header/body separator) while (client.readStringUntil('\n') != "\r"); + JsonDocument json; DeserializationError jerror = deserializeJson(json, client, DeserializationOption::Filter(filter)); if (jerror) { Serial.print("deserializeJson() failed: ");