提交 513ba78a 编写于 作者: M msheppar

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
上级 b64a0cb7
...@@ -1118,11 +1118,13 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetFullPathName0(JNIEnv *env, ...@@ -1118,11 +1118,13 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetFullPathName0(JNIEnv *env,
JNU_ThrowInternalError(env, "GetFullPathNameW failed"); JNU_ThrowInternalError(env, "GetFullPathNameW failed");
} }
free(lpBuf); free(lpBuf);
} else {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failure");
} }
} }
} } else {
if (len == 0)
throwWindowsException(env, GetLastError()); throwWindowsException(env, GetLastError());
}
return rv; return rv;
} }
...@@ -1157,13 +1159,13 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetFinalPathNameByHandle(JNIEnv* env, ...@@ -1157,13 +1159,13 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetFinalPathNameByHandle(JNIEnv* env,
JNU_ThrowInternalError(env, "GetFinalPathNameByHandleW failed"); JNU_ThrowInternalError(env, "GetFinalPathNameByHandleW failed");
} }
free(lpBuf); free(lpBuf);
} else {
JNU_ThrowOutOfMemoryError(env, "native memory allocation failure");
} }
} }
} } else {
if (len == 0)
throwWindowsException(env, GetLastError()); throwWindowsException(env, GetLastError());
}
return rv; return rv;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册