mirror of
https://github.com/openharmony/bundlemanager_bundle_framework_lite.git
synced 2026-07-01 10:05:30 -04:00
Issue:#IBFYPI
Description: null pointer protected Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: renjie84 renjie84@huawei.com Signed-off-by: 任杰 <renjie84@huawei.com>
This commit is contained in:
@@ -50,6 +50,9 @@ namespace OHOS {
|
||||
ManagerService::ManagerService()
|
||||
{
|
||||
installer_ = new (std::nothrow) BundleInstaller(INSTALL_PATH, DATA_PATH);
|
||||
if (installer_ == nullptr) {
|
||||
HILOG_ERROR(HILOG_MODULE_APP, "BundleMS BundleInstaller is nullptr");
|
||||
}
|
||||
bundleMap_ = BundleMap::GetInstance();
|
||||
}
|
||||
|
||||
@@ -183,6 +186,10 @@ void ManagerService::ServiceMsgProcess(Request* request)
|
||||
|
||||
if (installer_ == nullptr) {
|
||||
installer_ = new (std::nothrow) BundleInstaller(INSTALL_PATH, DATA_PATH);
|
||||
if (installer_ == nullptr) {
|
||||
HILOG_ERROR(HILOG_MODULE_APP, "BundleMS BundleInstaller is nullptr");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (request->msgId) {
|
||||
|
||||
@@ -35,6 +35,9 @@ public:
|
||||
List() : count_(0)
|
||||
{
|
||||
head_ = new (std::nothrow) Node<T>();
|
||||
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<T>(value);
|
||||
if (node == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
node->next_ = head_;
|
||||
node->prev_ = head_->prev_;
|
||||
|
||||
Reference in New Issue
Block a user