]> granicus.if.org Git - apache/commitdiff
Allocate correct size for the array to avoid useless memory allocation and copy
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 3 Jan 2014 21:42:40 +0000 (21:42 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 3 Jan 2014 21:42:40 +0000 (21:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555259 13f79535-47bb-0310-9956-ffa450edef68

modules/core/mod_macro.c

index 34ae3ad3c67ae86eb4135f9c37cf6cd43f9e3657..831769999ed9f43a696eb47affc101dd2d0fb1b6 100644 (file)
@@ -468,7 +468,7 @@ static const char *process_content(apr_pool_t * pool,
     int i;
 
     if (result) {
-        *result = apr_array_make(pool, 1, sizeof(char *));
+        *result = apr_array_make(pool, contents->nelts, sizeof(char *));
     }
 
     /* for each line of the macro body */