apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1528891 - in /apr/apr/branches/1.5.x: ./ file_io/os2/filedup.c file_io/unix/filedup.c file_io/win32/filedup.c strings/apr_strings.c
Date Thu, 03 Oct 2013 14:35:19 GMT
Author: rjung
Date: Thu Oct  3 14:35:18 2013
New Revision: 1528891

URL: http://svn.apache.org/r1528891
Log:
change apr_palloc+memcpy to apr_pmemdup

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

Backport of r1089438 from trunk.

Modified:
    apr/apr/branches/1.5.x/   (props changed)
    apr/apr/branches/1.5.x/file_io/os2/filedup.c
    apr/apr/branches/1.5.x/file_io/unix/filedup.c
    apr/apr/branches/1.5.x/file_io/win32/filedup.c
    apr/apr/branches/1.5.x/strings/apr_strings.c

Propchange: apr/apr/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1089438

Modified: apr/apr/branches/1.5.x/file_io/os2/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/os2/filedup.c?rev=1528891&r1=1528890&r2=1528891&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/os2/filedup.c (original)
+++ apr/apr/branches/1.5.x/file_io/os2/filedup.c Thu Oct  3 14:35:18 2013
@@ -86,8 +86,7 @@ APR_DECLARE(apr_status_t) apr_file_setas
                                             apr_file_t *old_file,
                                             apr_pool_t *p)
 {
-    *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t));
-    memcpy(*new_file, old_file, sizeof(apr_file_t));
+    *new_file = (apr_file_t *)apr_pmemdup(p, old_file, sizeof(apr_file_t));
     (*new_file)->pool = p;
 
     if (old_file->buffered) {

Modified: apr/apr/branches/1.5.x/file_io/unix/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/unix/filedup.c?rev=1528891&r1=1528890&r2=1528891&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/unix/filedup.c (original)
+++ apr/apr/branches/1.5.x/file_io/unix/filedup.c Thu Oct  3 14:35:18 2013
@@ -141,8 +141,7 @@ APR_DECLARE(apr_status_t) apr_file_setas
                                             apr_file_t *old_file,
                                             apr_pool_t *p)
 {
-    *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t));
-    memcpy(*new_file, old_file, sizeof(apr_file_t));
+    *new_file = (apr_file_t *)apr_pmemdup(p, old_file, sizeof(apr_file_t));
     (*new_file)->pool = p;
     if (old_file->buffered) {
         (*new_file)->buffer = apr_palloc(p, old_file->bufsize);

Modified: apr/apr/branches/1.5.x/file_io/win32/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/file_io/win32/filedup.c?rev=1528891&r1=1528890&r2=1528891&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/file_io/win32/filedup.c (original)
+++ apr/apr/branches/1.5.x/file_io/win32/filedup.c Thu Oct  3 14:35:18 2013
@@ -186,8 +186,7 @@ APR_DECLARE(apr_status_t) apr_file_setas
                                             apr_file_t *old_file,
                                             apr_pool_t *p)
 {
-    *new_file = (apr_file_t *)apr_palloc(p, sizeof(apr_file_t));
-    memcpy(*new_file, old_file, sizeof(apr_file_t));
+    *new_file = (apr_file_t *)apr_pmemdup(p, old_file, sizeof(apr_file_t));
     (*new_file)->pool = p;
     if (old_file->buffered) {
         (*new_file)->buffer = apr_palloc(p, old_file->bufsize);

Modified: apr/apr/branches/1.5.x/strings/apr_strings.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/strings/apr_strings.c?rev=1528891&r1=1528890&r2=1528891&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/strings/apr_strings.c (original)
+++ apr/apr/branches/1.5.x/strings/apr_strings.c Thu Oct  3 14:35:18 2013
@@ -75,8 +75,7 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool
         return NULL;
     }
     len = strlen(s) + 1;
-    res = apr_palloc(a, len);
-    memcpy(res, s, len);
+    res = apr_pmemdup(a, s, len);
     return res;
 }
 



Mime
View raw message