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
--- 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;
}