harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r1004624 - /harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c
Date Tue, 05 Oct 2010 12:42:51 GMT
Author: odeakin
Date: Tue Oct  5 12:42:50 2010
New Revision: 1004624

URL: http://svn.apache.org/viewvc?rev=1004624&view=rev
Log:
Fix memory leak of pathW.

Modified:
    harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c

Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c?rev=1004624&r1=1004623&r2=1004624&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c
Tue Oct  5 12:42:50 2010
@@ -400,11 +400,13 @@ PORT_ACCESS_FROM_ENV (env);
 I_32
 getPlatformIsWriteOnly (JNIEnv * env, char *path)
 {
+  PORT_ACCESS_FROM_ENV(env);
   HANDLE fHandle;
   wchar_t *pathW;
   convert_path_to_unicode(env,path,&pathW);
 
   fHandle = CreateFileW(pathW, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS,
NULL);
+  jclmem_free_memory(env, pathW);
   if (fHandle == INVALID_HANDLE_VALUE) {
     return 1;
   }



Mime
View raw message