From dd0c104b1f9aecac00d6bef44ee2d9f94d4dc818 Mon Sep 17 00:00:00 2001 From: shilei Date: Thu, 27 Jul 2023 12:21:29 +0000 Subject: [PATCH] fix memory leakage Signed-off-by: shilei Change-Id: Idb10c99229a18fccfc5b7d38f35f191c18f105e6 --- services/bundlemgr_lite/src/gt_bundle_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/bundlemgr_lite/src/gt_bundle_parser.cpp b/services/bundlemgr_lite/src/gt_bundle_parser.cpp index 5c82938..14da2fa 100644 --- a/services/bundlemgr_lite/src/gt_bundle_parser.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_parser.cpp @@ -550,13 +550,17 @@ bool GtBundleParser::ConvertIconResToBundleInfo(const char *resPath, uint32_t ic AdapterFree(bundleInfo->smallIconPath); if (isBigIconExisted) { bundleInfo->bigIconPath = bigIconPath; + AdapterFree(bigIconPngPath); } else { bundleInfo->bigIconPath = bigIconPngPath; + AdapterFree(bigIconPath); } if (isSmallIconExisted) { bundleInfo->smallIconPath = smallIconPath; + AdapterFree(smallIconPngPath); } else { bundleInfo->smallIconPath = smallIconPngPath; + AdapterFree(smallIconPath); } return true; } -- Gitee