harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r1001080 - /harmony/enhanced/java/trunk/jdktools/modules/samsa/src/main/native/samsa/samsa.c
Date Fri, 24 Sep 2010 21:19:29 GMT
Author: hindessm
Date: Fri Sep 24 21:19:27 2010
New Revision: 1001080

URL: http://svn.apache.org/viewvc?rev=1001080&view=rev
Log:
Fix more memory leaks.

Modified:
    harmony/enhanced/java/trunk/jdktools/modules/samsa/src/main/native/samsa/samsa.c

Modified: harmony/enhanced/java/trunk/jdktools/modules/samsa/src/main/native/samsa/samsa.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/jdktools/modules/samsa/src/main/native/samsa/samsa.c?rev=1001080&r1=1001079&r2=1001080&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/jdktools/modules/samsa/src/main/native/samsa/samsa.c (original)
+++ harmony/enhanced/java/trunk/jdktools/modules/samsa/src/main/native/samsa/samsa.c Fri Sep
24 21:19:27 2010
@@ -171,6 +171,7 @@ int main (int argc, char **argv, char **
     toolType = getToolType(root, toolName);
     if (toolType == -1) {
         fprintf(stderr, "Unable to determine type (JDK/JRE) of tool\n");
+        free(toolName);
         return 1;
     }
       
@@ -181,6 +182,7 @@ int main (int argc, char **argv, char **
     pToolData = getToolData(toolName, root, toolType);
        
     if (pToolData == NULL) { 
+        free(toolName);
         return 2;
     }
     
@@ -415,7 +417,7 @@ char *cleanToolName(const char *name) 
     _strlwr(temp);
 
     // remove possible '.exe' suffix
-	exe = strstr(temp, ".exe");
+    exe = strstr(temp, ".exe");
     if (exe) { 
        *exe = '\0';
     }
@@ -452,7 +454,8 @@ char *getRoot(const char* argv0) { 
         *last = '\0';
         return exeDir;
     }
-    
+
+    free(exeDir);
     return NULL;
 }
 



Mime
View raw message