harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r926708 - /harmony/enhanced/jchevm/libjc/jc_invoke.c
Date Tue, 23 Mar 2010 18:29:09 GMT
Author: hindessm
Date: Tue Mar 23 18:29:09 2010
New Revision: 926708

URL: http://svn.apache.org/viewvc?rev=926708&view=rev
Log:
Apply my patch from "[#HARMONY-579] [jchevm] trivial memory leak when
command line arguments are replaced/ignored".

Modified:
    harmony/enhanced/jchevm/libjc/jc_invoke.c

Modified: harmony/enhanced/jchevm/libjc/jc_invoke.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jchevm/libjc/jc_invoke.c?rev=926708&r1=926707&r2=926708&view=diff
==============================================================================
--- harmony/enhanced/jchevm/libjc/jc_invoke.c (original)
+++ harmony/enhanced/jchevm/libjc/jc_invoke.c Tue Mar 23 18:29:09 2010
@@ -271,6 +271,7 @@ _jc_invoke(int orig_ac, const char **ori
 			if (sub->jc != NULL) {
 
 				/* Delete old flag */
+				free(av[i]);
 				memmove(av + i, av + i + 1,
 				    (ac-- - i) * sizeof(*av));
 
@@ -284,6 +285,7 @@ _jc_invoke(int orig_ac, const char **ori
 			}
 
 			/* Just ignore it */
+			free(av[i]);
 			memmove(av + i, av + i + 1, (ac-- - i) * sizeof(*av));
 			i--;
 			break;



Mime
View raw message