From b4be920fac692c62a4058a1d0e7245b679d04d7e Mon Sep 17 00:00:00 2001 From: wangdengjia Date: Sun, 20 Mar 2022 19:23:44 +0800 Subject: [PATCH] IssueNo:#I4YNPN Description:Resolving the Problem Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangdengjia --- services/bundlemgr_lite/src/gt_bundle_manager_service.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index fc35e02..9794067 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -93,10 +93,12 @@ bool GtManagerService::Install(const char *hapPath, const InstallParam *installP // create new bundleInstallMsg bundleInstallMsg_ = reinterpret_cast(AdapterMalloc(sizeof(BundleInstallMsg))); if (bundleInstallMsg_ == nullptr) { + AdapterFree(path); return false; } if (memset_s(bundleInstallMsg_, sizeof(BundleInstallMsg), 0, sizeof(BundleInstallMsg)) != EOK) { AdapterFree(bundleInstallMsg_); + AdapterFree(path); return false; } // set bundleName、label、smallIconPath、bigIconPath in bundleInstallMsg_ @@ -320,6 +322,7 @@ void GtManagerService::InstallAllSystemBundle(InstallerCallback installerCallbac if (!BundleUtil::IsFile(((AppInfoList *)currentNode)->filePath) || !BundleUtil::EndWith(((AppInfoList *)currentNode)->filePath, INSTALL_FILE_SUFFIX)) { + GtManagerService::APP_FreeAllAppInfo(list); return; } (void) Install(((AppInfoList *)currentNode)->filePath, nullptr, installerCallback);