mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8204667: Resources not freed on exception
Reviewed-by: skoivu, chegar
This commit is contained in:
parent
e8fc5de2ab
commit
d686431d78
3 changed files with 42 additions and 17 deletions
|
@ -358,7 +358,9 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0
|
|||
int address1 = htonl(
|
||||
((struct sockaddr_in *)addrP->addr)->sin_addr.s_addr);
|
||||
int address2 = getInetAddress_addr(env, iaObj);
|
||||
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
goto cleanup;
|
||||
}
|
||||
if (address1 == address2) {
|
||||
match = JNI_TRUE;
|
||||
break;
|
||||
|
@ -404,6 +406,7 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0
|
|||
obj = createNetworkInterface(env, curr);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
// release the interface list
|
||||
freeif(ifs);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue