mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8231124: Missing closedir call with JDK-8223490
Reviewed-by: naoto
This commit is contained in:
parent
f88c32f6f6
commit
b59950bc49
1 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue