From: Christophe Jaillet Date: Fri, 3 Jan 2014 21:42:40 +0000 (+0000) Subject: Allocate correct size for the array to avoid useless memory allocation and copy X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=614069ea9c70e1ce3ee8a364de744d409b8dc3b0;p=thirdparty%2Fapache%2Fhttpd.git Allocate correct size for the array to avoid useless memory allocation and copy git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555259 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/core/mod_macro.c b/modules/core/mod_macro.c index 34ae3ad3c67..831769999ed 100644 --- a/modules/core/mod_macro.c +++ b/modules/core/mod_macro.c @@ -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 */