Package: collectd / 5.7.1-1.1

mqtt_resource_leak.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Description: mqtt plugin: Fix resource leak.
Author: Denys Fedoryshchenko <denys@visp.net.lb>

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);