diff -r b87dc103bf45 -r 2be326848943 src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Sat Nov 09 20:15:27 2019 +0800 +++ b/src/share/vm/runtime/arguments.cpp Sat Nov 09 20:29:45 2019 +0800 @@ -556,8 +556,7 @@ /* Scan the directory for jars/zips, appending them to path. */ struct dirent *entry; - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal); - while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { + while ((entry = os::readdir(dir)) != NULL) { const char* name = entry->d_name; const char* ext = name + strlen(name) - 4; bool isJarOrZip = ext > name && @@ -571,7 +570,6 @@ FREE_C_HEAP_ARRAY(char, jarpath, mtInternal); } } - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); os::closedir(dir); return path; } @@ -3485,14 +3483,12 @@ if (dir == NULL) return false; struct dirent *entry; - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal); bool hasJarFile = false; - while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { + while (!hasJarFile && (entry = os::readdir(dir)) != NULL) { const char* name = entry->d_name; const char* ext = name + strlen(name) - 4; hasJarFile = ext > name && (os::file_name_strcmp(ext, ".jar") == 0); } - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); os::closedir(dir); return hasJarFile ; } @@ -3574,8 +3570,7 @@ if (dir != NULL) { int num_ext_jars = 0; struct dirent *entry; - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(extDir), mtInternal); - while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { + while ((entry = os::readdir(dir)) != NULL) { const char* name = entry->d_name; const char* ext = name + strlen(name) - 4; if (ext > name && (os::file_name_strcmp(ext, ".jar") == 0)) { @@ -3594,7 +3589,6 @@ } } } - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); os::closedir(dir); if (num_ext_jars > 0) { nonEmptyDirs += 1;