You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2010/10/05 14:42:51 UTC
svn commit: r1004624 -
/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/native/luni/windows/helpers.c
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;
}