From dec526c98fafdbfd95d6a602e6ccde7393d6f38a Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 31 Dec 2024 15:41:42 +0800 Subject: [PATCH] IssueNo:#IBEWNX Description:fix code bug Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- services/bundlemgr_lite/src/bundle_manager_service.cpp | 3 +++ utils/bundle_lite/utils_list.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/services/bundlemgr_lite/src/bundle_manager_service.cpp b/services/bundlemgr_lite/src/bundle_manager_service.cpp index 12c817c..edb89fb 100644 --- a/services/bundlemgr_lite/src/bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/bundle_manager_service.cpp @@ -183,6 +183,9 @@ void ManagerService::ServiceMsgProcess(Request* request) if (installer_ == nullptr) { installer_ = new (std::nothrow) BundleInstaller(INSTALL_PATH, DATA_PATH); + if (installer_ == nullptr) { + return; + } } switch (request->msgId) { diff --git a/utils/bundle_lite/utils_list.h b/utils/bundle_lite/utils_list.h index ae5a959..a32577f 100644 --- a/utils/bundle_lite/utils_list.h +++ b/utils/bundle_lite/utils_list.h @@ -35,6 +35,9 @@ public: List() : count_(0) { head_ = new (std::nothrow) Node(); + if (head_ == nullptr) { + return; + } head_->next_ = head_; head_->prev_ = head_; } @@ -94,6 +97,9 @@ public: void PushBack(T value) { auto node = new (std::nothrow) Node(value); + if (node == nullptr) { + return; + } node->next_ = head_; node->prev_ = head_->prev_; -- Gitee