From 3f9c019cef74a8ebc9ebceaf64f59f3e99c30f25 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Mon, 23 Jan 2017 20:19:42 +0100 Subject: [PATCH] patches: add mqtt_resource_leak.patch --- debian/changelog | 5 +++-- debian/patches/mqtt_resource_leak.patch | 15 +++++++++++++++ debian/patches/series | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 debian/patches/mqtt_resource_leak.patch diff --git a/debian/changelog b/debian/changelog index f8563d9..c3e61f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 index 0000000..c07b29c --- /dev/null +++ b/debian/patches/mqtt_resource_leak.patch @@ -0,0 +1,15 @@ +Description: mqtt plugin: Fix resource leak. +Author: Denys Fedoryshchenko + +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); diff --git a/debian/patches/series b/debian/patches/series index 8c3f46b..b0cc80c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ rrd_filter_path.patch collection_conf_path.patch myplugin_includes.patch nagios-debian-paths.patch +mqtt_resource_leak.patch -- 2.30.2