Skip to content

Commit

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

Expand Down

0 comments on commit a9698c3

Please sign in to comment.