GetManifestDataForKey<const wgt::parse::ApplicationIconsInfo>(
app_keys::kIconsKey);
if (!icons_info) {
- icons_info.reset(new wgt::parse::ApplicationIconsInfo());
+ icons_info.reset(new(std::nothrow) wgt::parse::ApplicationIconsInfo());
+ if (!icons_info) {
+ LOG(ERROR) << "Out of memory";
+ return false;
+ }
}
wgt::parse::LocalizedApplicationIconsInfo localized_list =
wgt::parse::GetLocalizedIconList(*icons_info, widget_path_);
return common_installer::Step::Status::MANIFEST_NOT_FOUND;
}
- parser_.reset(new wgt::parse::WidgetConfigParser());
+ parser_.reset(new(std::nothrow) wgt::parse::WidgetConfigParser());
+ if (!parser_) {
+ LOG(ERROR) << "Out of memory";
+ return common_installer::Step::Status::CONFIG_ERROR;
+ }
if (!parser_->ParseManifest(widget_path_ / kConfigFileName)) {
LOG(ERROR) << "[Parse] Parse failed. " << parser_->GetErrorMessage();
return common_installer::Step::Status::PARSE_ERROR;