7084560: Crash in net.dll
authormichaelm
Tue, 30 Aug 2011 14:40:05 +0100
changeset 10417 947e9a7bf244
parent 10368 79494b8dc2b1
child 10418 1d57022fdb6e
7084560: Crash in net.dll Reviewed-by: chegar Contributed-by: luchsh@linux.vnet.ibm.com
jdk/src/windows/native/java/net/NetworkInterface.c
jdk/src/windows/native/java/net/NetworkInterface_winXP.c
--- a/jdk/src/windows/native/java/net/NetworkInterface.c	Sat Aug 27 15:40:45 2011 +0100
+++ b/jdk/src/windows/native/java/net/NetworkInterface.c	Tue Aug 30 14:40:05 2011 +0100
@@ -504,8 +504,7 @@
      */
     if (netaddrCount < 0) {
         netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
-        if ((*env)->ExceptionOccurred(env)) {
-            free_netaddr(netaddrP);
+        if (netaddrCount == -1) {
             return NULL;
         }
     }
--- a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c	Sat Aug 27 15:40:45 2011 +0100
+++ b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c	Tue Aug 30 14:40:05 2011 +0100
@@ -194,8 +194,7 @@
     while (curr != NULL) {
         netaddr *netaddrP;
         ret = enumAddresses_win(env, curr, &netaddrP);
-        if ((*env)->ExceptionOccurred(env)) {
-            free_netaddr(netaddrP);
+        if (ret == -1) {
             return -1;
         }
         curr->addrs = netaddrP;
@@ -449,8 +448,7 @@
      */
     if (netaddrCount < 0) {
         netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
-        if ((*env)->ExceptionOccurred(env)) {
-            free_netaddr(netaddrP);
+        if (netaddrCount == -1) {
             return NULL;
         }
     }