changeset 16520:661ab876769e

8048518: File Descriptor Leak in src/java.base/unix/native/libnet/net_util_md.c Reviewed-by: alanb, chegar
author chegar
date Sun, 22 May 2016 19:06:23 +0100
parents 997dcff5075f
children ea91cf963514
files src/java.base/unix/native/libnet/net_util_md.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/native/libnet/net_util_md.c	Sat May 21 13:18:15 2016 +0200
+++ b/src/java.base/unix/native/libnet/net_util_md.c	Sun May 22 19:06:23 2016 +0100
@@ -353,6 +353,7 @@
     if (getsockname(0, (struct sockaddr *)&sa, &sa_len) == 0) {
         struct sockaddr *saP = (struct sockaddr *)&sa;
         if (saP->sa_family != AF_INET6) {
+            close(fd);
             return JNI_FALSE;
         }
     }