From d9d52a27f05610653faa9023eedfad0136f3f9c2 Mon Sep 17 00:00:00 2001 From: Vyom Tewari Date: Mon, 7 Sep 2015 10:37:00 +0200 Subject: [PATCH] 8080486: JNI exception pending in jdk/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c Reviewed-by: alanb, chegar, igerasim --- jdk/src/java.base/share/native/libnet/InetAddress.c | 1 + .../java.base/windows/native/libnet/DualStackPlainSocketImpl.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/native/libnet/InetAddress.c b/jdk/src/java.base/share/native/libnet/InetAddress.c index 19e8fc2cad6..b2351c0fd8a 100644 --- a/jdk/src/java.base/share/native/libnet/InetAddress.c +++ b/jdk/src/java.base/share/native/libnet/InetAddress.c @@ -57,6 +57,7 @@ Java_java_net_InetAddress_init(JNIEnv *env, jclass cls) { c = (*env)->FindClass(env,"java/net/InetAddress$InetAddressHolder"); CHECK_NULL(c); iac_class = (*env)->NewGlobalRef(env, c); + CHECK_NULL(iac_class); ia_holderID = (*env)->GetFieldID(env, ia_class, "holder", "Ljava/net/InetAddress$InetAddressHolder;"); CHECK_NULL(ia_holderID); ia_preferIPv6AddressID = (*env)->GetStaticFieldID(env, ia_class, "preferIPv6Address", "Z"); diff --git a/jdk/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c b/jdk/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c index 40c0f7150f6..eccf785b23f 100644 --- a/jdk/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c +++ b/jdk/src/java.base/windows/native/libnet/DualStackPlainSocketImpl.c @@ -45,9 +45,10 @@ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_initIDs jclass cls = (*env)->FindClass(env, "java/net/InetSocketAddress"); CHECK_NULL(cls); isa_class = (*env)->NewGlobalRef(env, cls); + CHECK_NULL(isa_class); isa_ctorID = (*env)->GetMethodID(env, cls, "", "(Ljava/net/InetAddress;I)V"); - + CHECK_NULL(isa_ctorID); initInetAddressIDs(env); // implement read timeout with select.