From 98bfe15ca31dc5deaf29b9fbcdfb5a4241ea677c Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Fri, 6 Jan 2017 03:36:16 +0200 Subject: [PATCH] mqtt plugin: Fix resource leak. Fixes: #2123 --- src/mqtt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mqtt.c b/src/mqtt.c index 95deb007..6b76af97 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -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); -- 2.11.0