From 2832ea538dc35b747acc17d83dd39cbca84824ae Mon Sep 17 00:00:00 2001 From: sunman4 Date: Thu, 14 Apr 2022 11:39:50 +0800 Subject: [PATCH] =?UTF-8?q?GtManagerService::Install=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sunman4 --- 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 d132762..6166ba2 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -90,10 +90,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_ @@ -310,6 +312,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);