fix: memory leak due to wrong usage of arduinojson

This commit is contained in:
s3lph 2024-11-23 00:54:36 +01:00
parent 62b834f33e
commit da27fd1ceb
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5

View file

@ -32,7 +32,7 @@ WiFiUDP wifiUdp;
NTP ntp(wifiUdp); NTP ntp(wifiUdp);
Adafruit_NeoPixel pixels(WS2812_LEN, WS2812_PIN, NEO_RGB | NEO_KHZ800); Adafruit_NeoPixel pixels(WS2812_LEN, WS2812_PIN, NEO_RGB | NEO_KHZ800);
JsonDocument json, filter; JsonDocument filter;
ESP32Timer ITimer0(0); ESP32Timer ITimer0(0);
volatile bool wmp_needs_config_save; volatile bool wmp_needs_config_save;
@ -244,6 +244,7 @@ bool updateMap() {
// Read until empty line (HTTP header/body separator) // Read until empty line (HTTP header/body separator)
while (client.readStringUntil('\n') != "\r"); while (client.readStringUntil('\n') != "\r");
JsonDocument json;
DeserializationError jerror = deserializeJson(json, client, DeserializationOption::Filter(filter)); DeserializationError jerror = deserializeJson(json, client, DeserializationOption::Filter(filter));
if (jerror) { if (jerror) {
Serial.print("deserializeJson() failed: "); Serial.print("deserializeJson() failed: ");