apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1089438 - in /apr/apr/trunk: file_io/os2/filedup.c file_io/unix/filedup.c file_io/win32/filedup.c strings/apr_strings.c xlate/xlate.c
Date Wed, 06 Apr 2011 13:04:12 GMT
Author: trawick
Date: Wed Apr  6 13:04:12 2011
New Revision: 1089438

URL: http://svn.apache.org/viewvc?rev=1089438&view=rev
Log:
change apr_palloc+memcpy to apr_pmemdup

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

Modified:
    apr/apr/trunk/file_io/os2/filedup.c
    apr/apr/trunk/file_io/unix/filedup.c
    apr/apr/trunk/file_io/win32/filedup.c
    apr/apr/trunk/strings/apr_strings.c
    apr/apr/trunk/xlate/xlate.c

Modified: apr/apr/trunk/file_io/os2/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/os2/filedup.c?rev=1089438&r1=1089437&r2=1089438&view=diff
==============================================================================
--- apr/apr/trunk/file_io/os2/filedup.c (original)
+++ apr/apr/trunk/file_io/os2/filedup.c Wed Apr  6 13:04:12 2011
@@ -87,8 +87,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/trunk/file_io/unix/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/filedup.c?rev=1089438&r1=1089437&r2=1089438&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/filedup.c (original)
+++ apr/apr/trunk/file_io/unix/filedup.c Wed Apr  6 13:04:12 2011
@@ -152,8 +152,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/trunk/file_io/win32/filedup.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/win32/filedup.c?rev=1089438&r1=1089437&r2=1089438&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/filedup.c (original)
+++ apr/apr/trunk/file_io/win32/filedup.c Wed Apr  6 13:04:12 2011
@@ -187,8 +187,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/trunk/strings/apr_strings.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/strings/apr_strings.c?rev=1089438&r1=1089437&r2=1089438&view=diff
==============================================================================
--- apr/apr/trunk/strings/apr_strings.c (original)
+++ apr/apr/trunk/strings/apr_strings.c Wed Apr  6 13:04:12 2011
@@ -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;
 }
 

Modified: apr/apr/trunk/xlate/xlate.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/xlate/xlate.c?rev=1089438&r1=1089437&r2=1089438&view=diff
==============================================================================
--- apr/apr/trunk/xlate/xlate.c (original)
+++ apr/apr/trunk/xlate/xlate.c Wed Apr  6 13:04:12 2011
@@ -117,8 +117,8 @@ static void check_sbcs(apr_xlate_t *conv
          * close the iconv descriptor
          */
 
-        convset->sbcs_table = apr_palloc(convset->pool, sizeof(outbuf));
-        memcpy(convset->sbcs_table, outbuf, sizeof(outbuf));
+        convset->sbcs_table = apr_pmemdup(convset->pool, outbuf, sizeof(outbuf));
+
         iconv_close(convset->ich);
         convset->ich = (iconv_t)-1;
 



Mime
View raw message