diff --git a/debian/changelog b/debian/changelog index c373780..52f693d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ nagios-plugins (1.4.14-2) UNRELEASED; urgency=low * Add some hints to NEWS.Debian about the use on non-linux archs * Bump Standards-Version to 3.8.4, no changes needed * Add 1.0 to debian/source/format + * Add 43_check_http_large_pages_mleak.dpatch, taken from upstream, which + fixes memory leaks on large files - -- Jan Wagner Sat, 23 Jan 2010 01:39:31 +0100 + -- Jan Wagner Wed, 03 Mar 2010 08:13:31 +0100 nagios-plugins (1.4.14-1) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index 23375ff..d49f91e 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -18,3 +18,4 @@ 40_check_http_proxy_auth.dpatch 41_check_ping_detect_args.dpatch 42_check_linux_raid_fix_r10.dpatch +43_check_http_large_pages_mleak.dpatch diff --git a/debian/patches/43_check_http_large_pages_mleak.dpatch b/debian/patches/43_check_http_large_pages_mleak.dpatch new file mode 100644 index 0000000..a571d97 --- /dev/null +++ b/debian/patches/43_check_http_large_pages_mleak.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 43_check_http_large_pages_mleak.dpatch +## From: Ton Voon +## Date: Fri, 26 Feb 2010 12:47:38 +0000 +## Subject: [PATCH] Fix memory leak in check_http for large pages (Jimmy Bergman - #2957455) +## X-Git-Url: http://repo.or.cz/w/nagiosplugins.git?a=commitdiff_plain;h=6b782ebfd4832c1fe621556bcf894162b8caa8aa +## +## DP: Fix memory leak in check_http for large pages + +@DPATCH@ + +--- + plugins/check_http.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletions(-) + +diff --git a/plugins/check_http.c b/plugins/check_http.c +index 0a4b12b..5cdf144 100644 +--- a/plugins/check_http.c ++++ b/plugins/check_http.c +@@ -784,6 +784,7 @@ check_http (void) + int i = 0; + size_t pagesize = 0; + char *full_page; ++ char *full_page_new; + char *buf; + char *pos; + long microsec; +@@ -871,7 +872,9 @@ check_http (void) + full_page = strdup(""); + while ((i = my_recv (buffer, MAX_INPUT_BUFFER-1)) > 0) { + buffer[i] = '\0'; +- asprintf (&full_page, "%s%s", full_page, buffer); ++ asprintf (&full_page_new, "%s%s", full_page, buffer); ++ free (full_page); ++ full_page = full_page_new; + pagesize += i; + + if (no_body && document_headers_done (full_page)) { +-- +1.6.3 +