8261939: os::strdup_check_oom() should be used in os::same_files() in os_windows.cpp

Reviewed-by: minqi
This commit is contained in:
Calvin Cheung 2021-02-18 04:40:20 +00:00
parent 5f308291a0
commit b8fd61420c

View File

@ -4481,9 +4481,9 @@ bool os::same_files(const char* file1, const char* file2) {
return true;
}
char* native_file1 = os::strdup(file1);
char* native_file1 = os::strdup_check_oom(file1);
native_file1 = os::native_path(native_file1);
char* native_file2 = os::strdup(file2);
char* native_file2 = os::strdup_check_oom(file2);
native_file2 = os::native_path(native_file2);
if (strcmp(native_file1, native_file2) == 0) {
os::free(native_file1);