# HG changeset patch # User msheppar # Date 1395332348 0 # Node ID f65fec81a347c02daf3b6e9e78d24eef92d4c9f3 # Parent 0d1adf0afc2058d7bd9af063c080b06187c64fc0 8036134: Check src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c for JNI pending exceptions Summary: check malloc return value and added JUN_ThrowOutOfMemoryException Reviewed-by: alanb diff -r 0d1adf0afc20 -r f65fec81a347 jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c --- a/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c Thu Mar 20 15:25:57 2014 +0000 +++ b/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c Thu Mar 20 16:19:08 2014 +0000 @@ -1123,11 +1123,13 @@ JNU_ThrowInternalError(env, "GetFullPathNameW failed"); } free(lpBuf); + } else { + JNU_ThrowOutOfMemoryError(env, "native memory allocation failure"); } } + } else { + throwWindowsException(env, GetLastError()); } - if (len == 0) - throwWindowsException(env, GetLastError()); return rv; } @@ -1162,13 +1164,13 @@ JNU_ThrowInternalError(env, "GetFinalPathNameByHandleW failed"); } free(lpBuf); + } else { + JNU_ThrowOutOfMemoryError(env, "native memory allocation failure"); } } + } else { + throwWindowsException(env, GetLastError()); } - - if (len == 0) - throwWindowsException(env, GetLastError()); - return rv; }