From: André Malo Date: Thu, 3 Jul 2003 16:07:21 +0000 (+0000) Subject: catch out of memory condition (ID 29 of reasoning report) X-Git-Tag: pre_ajp_proxy~1484 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=140f805d9262802985b52a09ee6cfe34a55a30ba;p=apache catch out of memory condition (ID 29 of reasoning report) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100447 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/ab.c b/support/ab.c index 2af5d16f34..d17902ee24 100644 --- a/support/ab.c +++ b/support/ab.c @@ -1642,7 +1642,11 @@ static void test(void) * Combine headers and (optional) post file into one contineous buffer */ if (posting == 1) { - char *buff = (char *) malloc(postlen + reqlen + 1); + char *buff = malloc(postlen + reqlen + 1); + if (!buff) { + fprintf(stderr, "error creating request buffer: out of memory\n"); + return; + } strcpy(buff, request); strcpy(buff + reqlen, postdata); request = buff; @@ -1786,14 +1790,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.124 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.125 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AP_AB_BASEREVISION, "$Revision: 1.124 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AP_AB_BASEREVISION, "$Revision: 1.125 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n");