Skip to content

Commit

Permalink
Fixing memory leak in requestJsonApi(), kill client.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmtoblum committed Apr 15, 2020
1 parent 226aadc commit 4180fdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/request_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ boolean requestJsonApi(JsonDocument& doc, String url, String payload = "", size_
// Parse JSON data
DeserializationError error = deserializeJson(doc, *client);
client->stop();
delete client;
client = NULL;

if (error) {
DBG_PRINT(F("deserializeJson() failed: "));
DBG_PRINTLN(error.c_str());
Expand Down

0 comments on commit 4180fdb

Please sign in to comment.