This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch feature/coverity-fixes in repository https://gitbox.apache.org/repos/asf/celix.git
commit 421d6f68f2613562d6bd17b447f71ea114822cbe Author: PengZheng <[email protected]> AuthorDate: Thu Nov 23 14:22:42 2023 +0800 [CID 331914]Fix missing lock. --- libs/framework/src/framework.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/framework/src/framework.c b/libs/framework/src/framework.c index a28fa533..21df340b 100644 --- a/libs/framework/src/framework.c +++ b/libs/framework/src/framework.c @@ -2399,7 +2399,7 @@ void celix_framework_updateBundleAsync(celix_framework_t *fw, long bndId, const static celix_array_list_t* celix_framework_listBundlesInternal(celix_framework_t* framework, bool activeOnly) { celix_array_list_t* result = celix_arrayList_create(); - celixThreadMutex_lock(&framework->dispatcher.mutex); + celix_auto(celix_mutex_lock_guard_t) lock = celixMutexLockGuard_init(&framework->installedBundles.mutex); for (int i = 0; i < celix_arrayList_size(framework->installedBundles.entries); ++i) { celix_framework_bundle_entry_t* entry = celix_arrayList_get(framework->installedBundles.entries, i); if (entry->bndId == CELIX_FRAMEWORK_BUNDLE_ID) { @@ -2411,7 +2411,6 @@ static celix_array_list_t* celix_framework_listBundlesInternal(celix_framework_t celix_arrayList_addLong(result, entry->bndId); } } - celixThreadMutex_unlock(&framework->dispatcher.mutex); return result; }
