diff --git a/examples/mqttc/mqttc_pub.c b/examples/mqttc/mqttc_pub.c index a7d18c434..ea70a2d0c 100644 --- a/examples/mqttc/mqttc_pub.c +++ b/examples/mqttc/mqttc_pub.c @@ -174,6 +174,7 @@ static int initserver(const FAR struct mqttc_cfg_s *cfg) } close(fd); + fd = -1; } while ((itr = itr->ai_next) != NULL);