src/solaris/native/java/net/Inet6AddressImpl.c
Print this page
*** 194,203 ****
--- 194,207 ----
NET_ThrowNew(env, errno, "Can't get local interface addresses");
return NULL;
}
name = (*env)->NewStringUTF(env, hostname);
+ if (name == NULL) {
+ freeifaddrs(ifa);
+ return NULL;
+ }
/* Iterate over the interfaces, and total up the number of IPv4 and IPv6
* addresses we have. Also keep a count of loopback addresses. We need to
* exclude them in the normal case, but return them if we don't get an IP
* address.