changeset 4540:fe205518c3a7

7084560: Crash in net.dll Reviewed-by: chegar Contributed-by: luchsh@linux.vnet.ibm.com
author michaelm
date Tue, 30 Aug 2011 14:40:05 +0100
parents 83add4632b49
children ef4f24534a96
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	Sat Aug 27 15:40:45 2011 +0100
+++ 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	Sat Aug 27 15:40:45 2011 +0100
+++ 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;
         }
     }