Code

Added debian/patches/memcached_fdleak.dpatch.
authorSebastian Harl <sh@tokkee.org>
Wed, 17 Sep 2008 17:30:47 +0000 (19:30 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 17 Sep 2008 17:30:47 +0000 (19:30 +0200)
Trivial upstream patch to fix a possible file descriptor leak in the memcached
plugin.

debian/changelog
debian/patches/00list
debian/patches/memcached_fdleak.dpatch [new file with mode: 0755]

index 8d8d8fbf0cf68ff32452cb449b55f3f3a4649acd..1f60063f261ee3f5aec98af371f16f11e22c757d 100644 (file)
@@ -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 <sh@tokkee.org>  Wed, 17 Sep 2008 19:17:55 +0200
+ -- Sebastian Harl <sh@tokkee.org>  Wed, 17 Sep 2008 19:29:55 +0200
 
 collectd (4.4.2-1) unstable; urgency=low
 
index 9b2db92184df6ebfe0b63fa4f1fa408ca5d140a6..3a38f12ece54faa822c6269fb8f5e8220d2ee40f 100644 (file)
@@ -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 (executable)
index 0000000..e4f6037
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## memcached_fdleak.dpatch by Sebastian Harl <sh@tokkee.org>
+##
+## 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;
+               }
+       }