summaryrefslogtreecommitdiffstats
path: root/plugins/check_http.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2008-11-08 02:32:03 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2008-11-08 02:32:03 (GMT)
commit6c5f781bc58cef0a28ab2dbc7eeb1391df3ba009 (patch)
treeccc0cd52ce067193efecc1b4a05c9b86c5364a61 /plugins/check_http.c
parent288b742ed61bb62a210fdd3614d4e3883aa82407 (diff)
downloadmonitoring-plugins-6c5f781bc58cef0a28ab2dbc7eeb1391df3ba009.tar.gz
Fixed bug where extra headers and redirect caused segfault (Dieter Van de Walle - 2089159)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2076 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index df5daf2..0746741 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -815,7 +815,9 @@ check_http (void)
815 for ((pos = strtok(http_opt_headers[i], INPUT_DELIMITER)); pos; (pos = strtok(NULL, INPUT_DELIMITER))) 815 for ((pos = strtok(http_opt_headers[i], INPUT_DELIMITER)); pos; (pos = strtok(NULL, INPUT_DELIMITER)))
816 asprintf (&buf, "%s%s\r\n", buf, pos); 816 asprintf (&buf, "%s%s\r\n", buf, pos);
817 } 817 }
818 free(http_opt_headers); 818 /* This cannot be free'd here because a redirection will then try to access this and segfault */
819 /* Covered in a testcase in tests/check_http.t */
820 /* free(http_opt_headers); */
819 } 821 }
820 822
821 /* optionally send the authentication info */ 823 /* optionally send the authentication info */