mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 15:00:12 +00:00
Description: Add null checking logic for the return value of new to DisplayManager: Impl:: UpdateDisplayInfoLocked.
IssueNo: https://gitee.com/openharmony/window_window_manager/issues/I92X1U Signed-off-by: cuifeihe <cuifeihe@huawei.com>
This commit is contained in:
parent
6540b8ebe0
commit
a65f845a78
@ -1314,7 +1314,11 @@ bool DisplayManager::Impl::UpdateDisplayInfoLocked(sptr<DisplayInfo> displayInfo
|
||||
iter->second->UpdateDisplayInfo(displayInfo);
|
||||
return true;
|
||||
}
|
||||
sptr<Display> display = new Display("", displayInfo);
|
||||
sptr<Display> display = new (std::nothrow) Display("", displayInfo);
|
||||
if (display == nullptr) {
|
||||
WLOGFE("malloc display failed");
|
||||
return false;
|
||||
}
|
||||
displayMap_[displayId] = display;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user