This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch hotfix/coverity_fix in repository https://gitbox.apache.org/repos/asf/celix.git
commit ec5c1e6a61e96d3e8de95fe27b0a715de89a3509 Author: PengZheng <[email protected]> AuthorDate: Mon Apr 10 17:35:43 2023 +0800 Fix Coverity 211242 Dereference after null check. --- libs/framework/src/bundle_context.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libs/framework/src/bundle_context.c b/libs/framework/src/bundle_context.c index d2fc0a71..68150045 100644 --- a/libs/framework/src/bundle_context.c +++ b/libs/framework/src/bundle_context.c @@ -239,17 +239,11 @@ celix_status_t bundleContext_ungetService(bundle_context_pt context, service_ref } celix_status_t bundleContext_getBundles(bundle_context_pt context, array_list_pt *bundles) { - celix_status_t status = CELIX_SUCCESS; - - if (context == NULL || *bundles != NULL) { - status = CELIX_ILLEGAL_ARGUMENT; - } else { - *bundles = framework_getBundles(context->framework); - } - - framework_logIfError(context->framework->logger, status, NULL, "Failed to get bundles"); - - return status; + if (context == NULL || bundles == NULL) { + return CELIX_ILLEGAL_ARGUMENT; + } + *bundles = framework_getBundles(context->framework); + return CELIX_SUCCESS; } celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, bundle_pt *bundle) {
