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~22^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98bfe15ca31dc5deaf29b9fbcdfb5a4241ea677c;p=thirdparty%2Fcollectd.git mqtt plugin: Fix resource leak. Fixes: #2123 --- diff --git a/src/mqtt.c b/src/mqtt.c index 95deb0075..6b76af97b 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);