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-Tag: 2.5.0-alpha~4680 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fef0c66526906b573436bc12f82388ed0aa2b02c;p=apache 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 34ae3ad3c6..831769999e 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 */