changeset 23554:f65fec81a347

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
author msheppar
date Thu, 20 Mar 2014 16:19:08 +0000
parents 0d1adf0afc20
children 679ad1863be3
files jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }