1.1 --- a/src/share/vm/runtime/arguments.cpp Tue Apr 30 14:49:19 2019 +0200 1.2 +++ b/src/share/vm/runtime/arguments.cpp Mon Jun 17 16:41:38 2019 +0100 1.3 @@ -556,8 +556,7 @@ 1.4 1.5 /* Scan the directory for jars/zips, appending them to path. */ 1.6 struct dirent *entry; 1.7 - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal); 1.8 - while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { 1.9 + while ((entry = os::readdir(dir)) != NULL) { 1.10 const char* name = entry->d_name; 1.11 const char* ext = name + strlen(name) - 4; 1.12 bool isJarOrZip = ext > name && 1.13 @@ -571,7 +570,6 @@ 1.14 FREE_C_HEAP_ARRAY(char, jarpath, mtInternal); 1.15 } 1.16 } 1.17 - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); 1.18 os::closedir(dir); 1.19 return path; 1.20 } 1.21 @@ -3485,14 +3483,12 @@ 1.22 if (dir == NULL) return false; 1.23 1.24 struct dirent *entry; 1.25 - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal); 1.26 bool hasJarFile = false; 1.27 - while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { 1.28 + while (!hasJarFile && (entry = os::readdir(dir)) != NULL) { 1.29 const char* name = entry->d_name; 1.30 const char* ext = name + strlen(name) - 4; 1.31 hasJarFile = ext > name && (os::file_name_strcmp(ext, ".jar") == 0); 1.32 } 1.33 - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); 1.34 os::closedir(dir); 1.35 return hasJarFile ; 1.36 } 1.37 @@ -3574,8 +3570,7 @@ 1.38 if (dir != NULL) { 1.39 int num_ext_jars = 0; 1.40 struct dirent *entry; 1.41 - char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(extDir), mtInternal); 1.42 - while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) { 1.43 + while ((entry = os::readdir(dir)) != NULL) { 1.44 const char* name = entry->d_name; 1.45 const char* ext = name + strlen(name) - 4; 1.46 if (ext > name && (os::file_name_strcmp(ext, ".jar") == 0)) { 1.47 @@ -3594,7 +3589,6 @@ 1.48 } 1.49 } 1.50 } 1.51 - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); 1.52 os::closedir(dir); 1.53 if (num_ext_jars > 0) { 1.54 nonEmptyDirs += 1;