diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 4c50ff74..41e45e83 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -356,8 +356,8 @@ String MQTT::downstreamPacketToJson(MeshPacket *mp) {"payload", msgPayload}}; // serialize and return it - std::string jsonStr = jsonObj.dump(); + static std::string jsonStr = jsonObj.dump(); DEBUG_MSG("serialized json message: %s\n", jsonStr.c_str()); return jsonStr.c_str(); -} \ No newline at end of file +}