changeset 6070:3e4d5111a45e

7084560: Crash in net.dll Reviewed-by: chegar, michaelm
author luchsh
date Tue, 30 Aug 2011 14:40:05 +0100
parents e91dacb8d57f
children 705906be931d
files src/windows/native/java/net/NetworkInterface.c src/windows/native/java/net/NetworkInterface_winXP.c
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/java/net/NetworkInterface.c	Thu Mar 22 12:30:43 2012 +0800
+++ b/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/src/windows/native/java/net/NetworkInterface_winXP.c	Thu Mar 22 12:30:43 2012 +0800
+++ b/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;
         }
     }