httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r981085 - /httpd/httpd/trunk/modules/http/mod_mime.c
Date Sat, 31 Jul 2010 20:02:14 GMT
Author: sf
Date: Sat Jul 31 20:02:13 2010
New Revision: 981085

URL: http://svn.apache.org/viewvc?rev=981085&view=rev
Log:
Replace apr_palloc+memcpy by apr_memdup

Submitted by: Boya Sun <boya sun case edu>
PR: 39518

Modified:
    httpd/httpd/trunk/modules/http/mod_mime.c

Modified: httpd/httpd/trunk/modules/http/mod_mime.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/mod_mime.c?rev=981085&r1=981084&r2=981085&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/mod_mime.c (original)
+++ httpd/httpd/trunk/modules/http/mod_mime.c Sat Jul 31 20:02:13 2010
@@ -182,10 +182,10 @@ static void remove_items(apr_pool_t *p, 
                                               APR_HASH_KEY_STRING);
         if (exinfo && *(const char**)((char *)exinfo + suffix[i].offset)) {
             extension_info *copyinfo = exinfo;
-            exinfo = (extension_info*)apr_palloc(p, sizeof(*exinfo));
+            exinfo = apr_pmemdup(p, copyinfo, sizeof(*exinfo));
             apr_hash_set(mappings, suffix[i].name,
                          APR_HASH_KEY_STRING, exinfo);
-            memcpy(exinfo, copyinfo, sizeof(*exinfo));
+
             *(const char**)((char *)exinfo + suffix[i].offset) = NULL;
         }
     }



Mime
View raw message