diff --git a/src/xenia/kernel/fs/devices/disc_image_entry.cc b/src/xenia/kernel/fs/devices/disc_image_entry.cc index 049da7c64..ead4fd58d 100644 --- a/src/xenia/kernel/fs/devices/disc_image_entry.cc +++ b/src/xenia/kernel/fs/devices/disc_image_entry.cc @@ -67,7 +67,6 @@ X_STATUS DiscImageEntry::QueryInfo(XFileInfo* out_info) { X_STATUS DiscImageEntry::QueryDirectory( XDirectoryInfo* out_info, size_t length, bool restart) { XEASSERTNOTNULL(out_info); - xe_zero_struct(out_info, length); if (restart == true && gdfx_entry_iterator_ != gdfx_entry_->children.end()) { gdfx_entry_iterator_ = gdfx_entry_->children.end(); diff --git a/src/xenia/kernel/fs/devices/host_path_entry.cc b/src/xenia/kernel/fs/devices/host_path_entry.cc index 19678f83f..98db20b96 100644 --- a/src/xenia/kernel/fs/devices/host_path_entry.cc +++ b/src/xenia/kernel/fs/devices/host_path_entry.cc @@ -76,7 +76,6 @@ X_STATUS HostPathEntry::QueryInfo(XFileInfo* out_info) { X_STATUS HostPathEntry::QueryDirectory( XDirectoryInfo* out_info, size_t length, bool restart) { XEASSERTNOTNULL(out_info); - xe_zero_struct(out_info, length); WIN32_FIND_DATA ffd; diff --git a/src/xenia/kernel/fs/devices/stfs_container_entry.cc b/src/xenia/kernel/fs/devices/stfs_container_entry.cc index 0bfe7ceb9..897dfe060 100644 --- a/src/xenia/kernel/fs/devices/stfs_container_entry.cc +++ b/src/xenia/kernel/fs/devices/stfs_container_entry.cc @@ -46,7 +46,6 @@ X_STATUS STFSContainerEntry::QueryInfo(XFileInfo* out_info) { X_STATUS STFSContainerEntry::QueryDirectory( XDirectoryInfo* out_info, size_t length, bool restart) { XEASSERTNOTNULL(out_info); - xe_zero_struct(out_info, length); if (restart && stfs_entry_iterator_ != stfs_entry_->children.end()) { stfs_entry_iterator_ = stfs_entry_->children.end(); diff --git a/src/xenia/kernel/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl_io.cc index b3fedfc32..ea80b0db4 100644 --- a/src/xenia/kernel/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl_io.cc @@ -530,12 +530,13 @@ SHIM_CALL NtQueryDirectoryFile_shim( result = state->object_table()->GetObject( file_handle, (XObject**)&file); if (XSUCCEEDED(result)) { - XDirectoryInfo* dirInfo = (XDirectoryInfo*)xe_malloc(length); - result = file->QueryDirectory(dirInfo, length, restart_scan != 0); + XDirectoryInfo* dir_info = (XDirectoryInfo*)xe_calloc(length); + result = file->QueryDirectory(dir_info, length, restart_scan != 0); if (XSUCCEEDED(result)) { - dirInfo->Write(SHIM_MEM_BASE, file_info_ptr); + dir_info->Write(SHIM_MEM_BASE, file_info_ptr); info = length; } + xe_free(dir_info); } if (XFAILED(result)) {