7084560: Crash in net.dll
Reviewed-by: chegar
Contributed-by: luchsh@linux.vnet.ibm.com
--- 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;
}
}