8231124: Missing closedir call with JDK-8223490

Reviewed-by: naoto
This commit is contained in:
Sean Coffey 2019-09-17 16:39:56 +00:00
parent f88c32f6f6
commit b59950bc49

View file

@ -130,11 +130,6 @@ findZoneinfoFile(char *buf, size_t size, const char *dir)
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 @@ findZoneinfoFile(char *buf, size_t size, const char *dir)
}
}
dirp = opendir(dir);
if (dirp == NULL) {
return NULL;
}
while ((dp = readdir(dirp)) != NULL) {
/*
* Skip '.' and '..' (and possibly other .* files)