changeset 56291:8a8e87e8a4fd

8231124: Missing closedir call with JDK-8223490 Reviewed-by: naoto
author coffeys
date Tue, 17 Sep 2019 16:39:56 +0000
parents 9adf95692a3d
children 6a05019acb67
files src/java.base/unix/native/libjava/TimeZone_md.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/native/libjava/TimeZone_md.c	Tue Sep 17 08:22:14 2019 -0400
+++ b/src/java.base/unix/native/libjava/TimeZone_md.c	Tue Sep 17 16:39:56 2019 +0000
@@ -130,11 +130,6 @@
     char *tz = NULL;
     int res;
 
-    dirp = opendir(dir);
-    if (dirp == NULL) {
-        return NULL;
-    }
-
     if (strcmp(dir, ZONEINFO_DIR) == 0) {
         /* fast path for 1st iteration */
         for (unsigned int i = 0; i < sizeof (popularZones) / sizeof (popularZones[0]); i++) {
@@ -151,6 +146,11 @@
         }
     }
 
+    dirp = opendir(dir);
+    if (dirp == NULL) {
+        return NULL;
+    }
+
     while ((dp = readdir(dirp)) != NULL) {
         /*
          * Skip '.' and '..' (and possibly other .* files)