Skip to content

Commit

Permalink
Merge pull request #633 from EricCarrGH/master
Browse files Browse the repository at this point in the history
Memory leak fix - json_print call
  • Loading branch information
tschak909 authored Jul 18, 2023
2 parents ba5c803 + a412c44 commit 9ed3310
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fnjson/fnjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ bool FNJSON::parse()
return false;
}

Debug_printf("Parsed JSON: %s\r\n", cJSON_Print(_json));
char* debugOutput = cJSON_Print(_json);
if (debugOutput != nullptr) {
Debug_printf("Parsed JSON: %s\r\n", debugOutput);
cJSON_free(debugOutput);
}

return true;
}
Expand Down

0 comments on commit 9ed3310

Please sign in to comment.