diff --git a/MQTTClient-C/src/MQTTClient.c b/MQTTClient-C/src/MQTTClient.c index 73edad7f..f7a1bd1a 100755 --- a/MQTTClient-C/src/MQTTClient.c +++ b/MQTTClient-C/src/MQTTClient.c @@ -235,7 +235,9 @@ int keepalive(MQTTClient* c) void MQTTCleanSession(MQTTClient* c) { - for (int i = 0; i < MAX_MESSAGE_HANDLERS; ++i) + int i = 0; + + for (i = 0; i < MAX_MESSAGE_HANDLERS; ++i) c->messageHandlers[i].topicFilter = NULL; }