httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1555259 - /httpd/httpd/trunk/modules/core/mod_macro.c
Date Fri, 03 Jan 2014 21:42:41 GMT
Author: jailletc36
Date: Fri Jan  3 21:42:40 2014
New Revision: 1555259

URL: http://svn.apache.org/r1555259
Log:
Allocate correct size for the array to avoid useless memory allocation and copy

Modified:
    httpd/httpd/trunk/modules/core/mod_macro.c

Modified: httpd/httpd/trunk/modules/core/mod_macro.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/core/mod_macro.c?rev=1555259&r1=1555258&r2=1555259&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/core/mod_macro.c (original)
+++ httpd/httpd/trunk/modules/core/mod_macro.c Fri Jan  3 21:42:40 2014
@@ -468,7 +468,7 @@ static const char *process_content(apr_p
     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 */



Mime
View raw message