Skip to content

Commit

Permalink
serveJson: Fix possible memory leak
Browse files Browse the repository at this point in the history
Ensure we delete the response if it's not locked
  • Loading branch information
willmmiles committed Jan 6, 2024
1 parent 9d3c0f4 commit 7711617
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wled00/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ void serveJson(AsyncWebServerRequest* request)
if (!response->owns_lock()) {
serveJsonError(request, 503, ERR_NOBUF);
servingClient = false;
delete response;
return;
}

Expand Down

0 comments on commit 7711617

Please sign in to comment.