From b3b820c7f4d0e29998310193d81b006745107544 Mon Sep 17 00:00:00 2001 From: wangdengjia Date: Sun, 20 Mar 2022 08:22:01 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=BD=BB=E9=B8=BF=E8=92=99?= =?UTF-8?q?=E5=8C=85=E7=AE=A1=E7=90=86=E5=86=85=E5=AD=98=E6=B3=84=E9=9C=B2?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E8=A7=A3=E5=86=B3=E8=BD=BB=E9=B8=BF?= =?UTF-8?q?=E8=92=99=E5=8C=85=E7=AE=A1=E7=90=86=E5=86=85=E5=AD=98=E6=B3=84?= =?UTF-8?q?=E9=9C=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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); -- Gitee