From 9217458353b98bee50ce0d0ef353aca9e164f456 Mon Sep 17 00:00:00 2001 From: Clemens Kirchgatterer Date: Sun, 11 Feb 2024 12:27:18 +0100 Subject: [PATCH] Free memory for _currentArgs after request has been handled in WebServer. (#9077) This can reduce permanent RAM consumption significantly, if the last request had lots of arguments, but it assumes, that we do not need the arguments after we have handled a request. --- libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h index ddbdbe5f41..f7a95da0af 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h @@ -726,9 +726,11 @@ void ESP8266WebServerTemplate::_handleRequest() { _finalizeResponse(); } _currentUri = ""; + delete[] _currentArgs; + _currentArgs = nullptr; + _currentArgCount = 0; } - template void ESP8266WebServerTemplate::_finalizeResponse() { if (_chunked) {