diff --git a/src/v2i-hub/TelematicBridgePlugin/src/TelematicBridgeMsgWorker.h b/src/v2i-hub/TelematicBridgePlugin/src/TelematicBridgeMsgWorker.h index ec67f8432..7b512bb43 100644 --- a/src/v2i-hub/TelematicBridgePlugin/src/TelematicBridgeMsgWorker.h +++ b/src/v2i-hub/TelematicBridgePlugin/src/TelematicBridgeMsgWorker.h @@ -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(cJSON_Print(msg->payload)); - json["payload"] = StringToJson(*payloadPtr); + std::unique_ptr payloadPtr{ cJSON_Print(msg->payload), std::free }; + json["payload"] = StringToJson(payloadPtr.get()); } }