harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r959886 - /harmony/enhanced/java/trunk/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c
Date Fri, 02 Jul 2010 07:28:52 GMT
Author: regisxu
Date: Fri Jul  2 07:28:52 2010
New Revision: 959886

URL: http://svn.apache.org/viewvc?rev=959886&view=rev
Log:
remove unnecessary strdup calls, and clean more memory.

Modified:
    harmony/enhanced/java/trunk/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c

Modified: harmony/enhanced/java/trunk/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c?rev=959886&r1=959885&r2=959886&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c (original)
+++ harmony/enhanced/java/trunk/classlib/modules/portlib/src/main/native/a2e/unix/atoe.c Fri
Jul  2 07:28:52 2010
@@ -2042,7 +2042,7 @@ atoe_execv (const char *path, char *cons
     /* Allocate space for the new array and populate */
     ebcdicArgv = (char**) malloc(sizeof(char*) * (size + 1));
     for (i = 0; i < size; i++) {
-        *(ebcdicArgv + i) = strdup(a2e_string(argv[i]));
+        *(ebcdicArgv + i) = a2e_string(argv[i]);
     }
 
     /* Null terminate the new array */
@@ -2054,6 +2054,7 @@ atoe_execv (const char *path, char *cons
         free(*(ebcdicArgv + i));
     }
     free(ebcdicArgv);
+    free(ebcdicPath);
 
     return rc;
 }
@@ -2079,7 +2080,7 @@ atoe_execvp (const char *file, char *con
     /* Allocate space for the new array and populate */
     ebcdicArgv = (char**) malloc(sizeof(char*) * (size + 1));
     for (i = 0; i < size; i++) {
-        *(ebcdicArgv + i) = strdup(a2e_string(argv[i]));
+        *(ebcdicArgv + i) = a2e_string(argv[i]);
     }
 
     /* Null terminate the new array */
@@ -2091,6 +2092,7 @@ atoe_execvp (const char *file, char *con
         free(*(ebcdicArgv + i));
     }
     free(ebcdicArgv);
+    free(ebcdicPath);
 
     return rc;
 }



Mime
View raw message