From acfd0a9b4eb765364d65267ec071dc31a2b7088d Mon Sep 17 00:00:00 2001 From: Sara Souza Date: Wed, 14 Apr 2021 19:58:49 -0300 Subject: [PATCH] examples/mqttc: If connection() fails, then fd becomes invalid --- examples/mqttc/mqttc_pub.c | 1 + 1 file changed, 1 insertion(+) 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);