From: Denys Fedoryshchenko Date: Fri, 6 Jan 2017 01:36:16 +0000 (+0200) Subject: mqtt plugin: Fix resource leak. X-Git-Tag: collectd-5.7.2~18^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=98bfe15ca31dc5deaf29b9fbcdfb5a4241ea677c;p=collectd.git mqtt plugin: Fix resource leak. Fixes: #2123 --- 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);