From ae186d9da6dcb22275a5df92485ea7c92598f715 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 17 Sep 2008 19:30:47 +0200 Subject: [PATCH] Added debian/patches/memcached_fdleak.dpatch. Trivial upstream patch to fix a possible file descriptor leak in the memcached plugin. --- debian/changelog | 4 +++- debian/patches/00list | 1 + debian/patches/memcached_fdleak.dpatch | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 debian/patches/memcached_fdleak.dpatch diff --git a/debian/changelog b/debian/changelog index 8d8d8fb..1f60063 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,10 @@ collectd (4.4.2-2) unstable; urgency=low fix a possible memory leak. * Added debian/patches/snmp_memleak.dpatch - trivial upstream patch to fix a possible memory leak in the snmp plugin. + * Added debian/patches/memcached_fdleak.dpatch - trivial upstream patch to + fix a possible file descriptor leak in the memcached plugin. - -- Sebastian Harl Wed, 17 Sep 2008 19:17:55 +0200 + -- Sebastian Harl Wed, 17 Sep 2008 19:29:55 +0200 collectd (4.4.2-1) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index 9b2db92..3a38f12 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -4,4 +4,5 @@ myplugin_strcpy.dpatch memory_libstatgrab.dpatch collectd_memleak.dpatch snmp_memleak.dpatch +memcached_fdleak.dpatch diff --git a/debian/patches/memcached_fdleak.dpatch b/debian/patches/memcached_fdleak.dpatch new file mode 100755 index 0000000..e4f6037 --- /dev/null +++ b/debian/patches/memcached_fdleak.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## memcached_fdleak.dpatch by Sebastian Harl +## +## DP: Fixed a possible file descriptor leak in the memcached plugin. +## DP: This has been reported as upstream bug #26. +## DP: (This is based on upstream Git commit +## DP: e7929dac268957cbbd9082717759c3917ac1b51e) + +@DPATCH@ + +diff a/src/memcached.c b/src/memcached.c +--- a/src/memcached.c ++++ b/src/memcached.c +@@ -137,6 +137,8 @@ static int memcached_query_daemon (char *buffer, int buffer_size) /* {{{ */ + + if (n <= 0) { + ERROR ("memcached: poll() failed or timed out"); ++ shutdown (fd, SHUT_RDWR); ++ close (fd); + return -1; + } + } -- 2.30.2