summaryrefslogtreecommitdiffstats
path: root/web/attachments/364105-check_http_memory_leak.patch
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
commit0b6423f9c99d9edf8c96fefd0f6c453859395aa1 (patch)
tree1c2b6b21704a294940f87c7892676998d8371707 /web/attachments/364105-check_http_memory_leak.patch
downloadsite-0b6423f9c99d9edf8c96fefd0f6c453859395aa1.tar.gz
Import Nagios Plugins site
Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files.
Diffstat (limited to 'web/attachments/364105-check_http_memory_leak.patch')
-rw-r--r--web/attachments/364105-check_http_memory_leak.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/web/attachments/364105-check_http_memory_leak.patch b/web/attachments/364105-check_http_memory_leak.patch
new file mode 100644
index 0000000..49a35b8
--- /dev/null
+++ b/web/attachments/364105-check_http_memory_leak.patch
@@ -0,0 +1,23 @@
1diff --git a/plugins/check_http.c b/plugins/check_http.c
2index 0a4b12b..5cdf144 100644
3--- a/plugins/check_http.c
4+++ b/plugins/check_http.c
5@@ -784,6 +784,7 @@ check_http (void)
6 int i = 0;
7 size_t pagesize = 0;
8 char *full_page;
9+ char *full_page_new;
10 char *buf;
11 char *pos;
12 long microsec;
13@@ -871,7 +872,9 @@ check_http (void)
14 full_page = strdup("");
15 while ((i = my_recv (buffer, MAX_INPUT_BUFFER-1)) > 0) {
16 buffer[i] = '\0';
17- asprintf (&full_page, "%s%s", full_page, buffer);
18+ asprintf (&full_page_new, "%s%s", full_page, buffer);
19+ free (full_page);
20+ full_page = full_page_new;
21 pagesize += i;
22
23 if (no_body && document_headers_done (full_page)) {