mqtt plugin: Fix resource leak.
authorDenys Fedoryshchenko <denys@visp.net.lb>
Sun, 5 Feb 2017 19:40:33 +0000 (19:40 +0000)
committerSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Sun, 5 Feb 2017 19:40:33 +0000 (19:40 +0000)
Gbp-Pq: Name mqtt_resource_leak.patch

src/mqtt.c

index b578b99bb93505f27a344b88d512cad2d97aa432..7e6ce72284e04fcf82c6cb2bb7df1d92467b1ccf 100644 (file)
@@ -448,6 +448,7 @@ static int publish(mqtt_client_conf_t *conf, char const *topic,
      * measure; we will try to reconnect the next time we have to publish a
      * message */
     conf->connected = 0;
+    mosquitto_disconnect(conf->mosq);
 
     pthread_mutex_unlock(&conf->lock);
     return (-1);