From: Junghyun Yeon Date: Tue, 17 Oct 2017 02:40:02 +0000 (+0900) Subject: Fix static analysis issue X-Git-Tag: accepted/tizen/4.0/unified/20171018.060928~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F156002%2F1;p=platform%2Fcore%2Fappfw%2Fwgt-backend.git Fix static analysis issue - Check if new operator has failed. Change-Id: I840874abdac89bb91f6e5aca26df2ac265a541ac Signed-off-by: Junghyun Yeon --- diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index aa62f48..0fe8083 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -200,7 +200,11 @@ bool StepParse::FillIconPaths(manifest_x* manifest) { GetManifestDataForKey( 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_); @@ -867,7 +871,11 @@ common_installer::Step::Status StepParse::process() { 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;