Code

patches: add mqtt_resource_leak.patch
authorMarc Fournier <marc@bl.uem.li>
Mon, 23 Jan 2017 19:19:42 +0000 (20:19 +0100)
committerMarc Fournier <marc@bl.uem.li>
Mon, 23 Jan 2017 19:44:39 +0000 (20:44 +0100)
debian/changelog
debian/patches/mqtt_resource_leak.patch [new file with mode: 0644]
debian/patches/series

index f8563d95e16ad1d68421213146afd49f5f9e67a5..c3e61f605ecd7028f15f46befd753a1f4d035624 100644 (file)
@@ -1,8 +1,9 @@
 collectd (5.7.1-1) UNRELEASED; urgency=medium
 
   * New upstream release.
-  * debian/patches: drop dpdkstat-portable-format-string.patch, included
-    upstream.
+  * debian/patches:
+    - drop dpdkstat-portable-format-string.patch, included upstream.
+    - add mqtt_resource_leak.patch, fixing a connection leak.
 
  -- Marc Fournier <marc@bl.uem.li>  Mon, 23 Jan 2017 09:23:07 +0100
 
diff --git a/debian/patches/mqtt_resource_leak.patch b/debian/patches/mqtt_resource_leak.patch
new file mode 100644 (file)
index 0000000..c07b29c
--- /dev/null
@@ -0,0 +1,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);
index 8c3f46b2e3722b791529ef4ad0b272c6927927ab..b0cc80c093f4f6760ea0e503eb377c63ea2b6d6d 100644 (file)
@@ -2,3 +2,4 @@ rrd_filter_path.patch
 collection_conf_path.patch
 myplugin_includes.patch
 nagios-debian-paths.patch
+mqtt_resource_leak.patch