diff --git a/Sming/Core/Network/MqttClient.cpp b/Sming/Core/Network/MqttClient.cpp index 28379d0daf..932b51cb96 100644 --- a/Sming/Core/Network/MqttClient.cpp +++ b/Sming/Core/Network/MqttClient.cpp @@ -225,6 +225,11 @@ bool MqttClient::connect(const Url& url, const String& clientName, uint32_t sslO } } + if(requestQueue.full()) { + debug_e("MQTT request queue full!"); + return false; + } + mqtt_message_t* message = (mqtt_message_t*)malloc(sizeof(mqtt_message_t)); memcpy(message, &connectMessage, sizeof(mqtt_message_t)); requestQueue.enqueue(message);