]> granicus.if.org Git - apache/commitdiff
catch out of memory condition (ID 29 of reasoning report)
authorAndré Malo <nd@apache.org>
Thu, 3 Jul 2003 16:07:21 +0000 (16:07 +0000)
committerAndré Malo <nd@apache.org>
Thu, 3 Jul 2003 16:07:21 +0000 (16:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100447 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index 2af5d16f341507db1685f4cce014ffc8222c6688..d17902ee24dc91367615dba14795c038f1d28067 100644 (file)
@@ -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("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.124 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.125 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");