Skip to content

Commit

Permalink
Free memory for _currentArgs after request has been handled in WebSer…
Browse files Browse the repository at this point in the history
…ver. (#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.
  • Loading branch information
everslick authored Feb 11, 2024
1 parent ed9e8ce commit 9217458
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,11 @@ void ESP8266WebServerTemplate<ServerType>::_handleRequest() {
_finalizeResponse();
}
_currentUri = "";
delete[] _currentArgs;
_currentArgs = nullptr;
_currentArgCount = 0;
}


template <typename ServerType>
void ESP8266WebServerTemplate<ServerType>::_finalizeResponse() {
if (_chunked) {
Expand Down

0 comments on commit 9217458

Please sign in to comment.