examples/mqttc: If connection() fails, then fd becomes invalid

This commit is contained in:
Sara Souza 2021-04-14 19:58:49 -03:00 committed by Alan Carvalho de Assis
parent 0ee6f0e5e0
commit acfd0a9b4e

View File

@ -174,6 +174,7 @@ static int initserver(const FAR struct mqttc_cfg_s *cfg)
} }
close(fd); close(fd);
fd = -1;
} }
while ((itr = itr->ai_next) != NULL); while ((itr = itr->ai_next) != NULL);