This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch hotfix/framework-startup-optimization in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to refs/heads/hotfix/framework-startup-optimization by this push: new 9a0709b0 Fix a potential memory leak. 9a0709b0 is described below commit 9a0709b03e6e75529b08ab82d4b87e05206d19ac Author: PengZheng <howto...@gmail.com> AuthorDate: Thu Aug 3 09:16:32 2023 +0800 Fix a potential memory leak. --- libs/framework/src/bundle_archive.c | 2 +- libs/framework/src/celix_bundle_cache.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/framework/src/bundle_archive.c b/libs/framework/src/bundle_archive.c index c8880dae..57207296 100644 --- a/libs/framework/src/bundle_archive.c +++ b/libs/framework/src/bundle_archive.c @@ -109,7 +109,7 @@ static celix_status_t celix_bundleArchive_removeResourceCache(bundle_archive_t* fw_logCode(archive->fw->logger, CELIX_LOG_LEVEL_ERROR, status, "Failed to stat bundle archive directory '%s'", archive->resourceCacheRoot); return status; } - // assert(status == 0); + assert(status == 0); // celix_utils_deleteDirectory does not work for dangling symlinks, so handle this case separately if (S_ISLNK(st.st_mode)) { status = unlink(archive->resourceCacheRoot); diff --git a/libs/framework/src/celix_bundle_cache.c b/libs/framework/src/celix_bundle_cache.c index f69d03da..b6191ab0 100644 --- a/libs/framework/src/celix_bundle_cache.c +++ b/libs/framework/src/celix_bundle_cache.c @@ -272,6 +272,7 @@ static void celix_bundleCache_updateIdForLocationLookupMap(celix_bundle_cache_t* } celix_properties_destroy(props); } + celix_utils_freeStringIfNotEqual(archiveRootBuffer, bundleStateProperties); } closedir(dir); }