Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Apr 15, 2024
1 parent 50de700 commit 47a2b4b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,8 @@ namespace TelematicBridge
else
{
// Render a cJSON entity to text for transfer/storage. Free the char* when finished.
char * payloadPtr = cJSON_Print(msg->payload);
json["payload"] = StringToJson(payloadPtr);
free(payloadPtr);
auto payloadPtr = std::make_unique<char*>(cJSON_Print(msg->payload));
json["payload"] = StringToJson(*payloadPtr);
}
}

Expand Down

0 comments on commit 47a2b4b

Please sign in to comment.