diff --git a/extras/paho_mqtt_c/MQTTClient.c b/extras/paho_mqtt_c/MQTTClient.c index e8209ea..c2419c3 100644 --- a/extras/paho_mqtt_c/MQTTClient.c +++ b/extras/paho_mqtt_c/MQTTClient.c @@ -424,6 +424,8 @@ int mqtt_subscribe(mqtt_client_t* c, const char* topic, enum mqtt_qos qos, mqtt if (rc != 0x80) { int i; + + rc = MQTT_FAILURE; for (i = 0; i < MQTT_MAX_MESSAGE_HANDLERS; ++i) { if (c->messageHandlers[i].topicFilter == 0)