8230856: Java_java_net_NetworkInterface_getByName0 on unix misses ReleaseStringUTFChars in early return
authormbaesken
Wed, 11 Sep 2019 16:13:05 +0200
changeset 58098 ea93d6a9f720
parent 58097 fa0514bdc09b
child 58102 b2a4b22f8cf2
8230856: Java_java_net_NetworkInterface_getByName0 on unix misses ReleaseStringUTFChars in early return Reviewed-by: dfuchs, stuefe, vtewari
src/java.base/unix/native/libnet/NetworkInterface.c
--- a/src/java.base/unix/native/libnet/NetworkInterface.c	Wed Sep 11 16:54:53 2019 +0200
+++ b/src/java.base/unix/native/libnet/NetworkInterface.c	Wed Sep 11 16:13:05 2019 +0200
@@ -239,6 +239,7 @@
 
     ifs = enumInterfaces(env);
     if (ifs == NULL) {
+        (*env)->ReleaseStringUTFChars(env, name, name_utf);
         return NULL;
     }