You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pe...@apache.org on 2023/04/10 10:51:15 UTC
[celix] 12/32: Fix Coverity 211182 Dereference after null check.
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 661d6a394136704f45171c786bcc990e2c146c84
Author: PengZheng <ho...@gmail.com>
AuthorDate: Mon Apr 10 16:23:57 2023 +0800
Fix Coverity 211182 Dereference after null check.
---
libs/framework/src/bundle_context.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/libs/framework/src/bundle_context.c b/libs/framework/src/bundle_context.c
index 26ff074c..42e12676 100644
--- a/libs/framework/src/bundle_context.c
+++ b/libs/framework/src/bundle_context.c
@@ -373,17 +373,10 @@ celix_status_t bundleContext_removeBundleListener(bundle_context_pt context, bun
}
celix_status_t bundleContext_addFrameworkListener(bundle_context_pt context, framework_listener_pt listener) {
- celix_status_t status = CELIX_SUCCESS;
-
- if (context != NULL && listener != NULL) {
- fw_addFrameworkListener(context->framework, context->bundle, listener);
- } else {
- status = CELIX_ILLEGAL_ARGUMENT;
+ if (context == NULL || listener == NULL) {
+ return CELIX_ILLEGAL_ARGUMENT;
}
-
- framework_logIfError(context->framework->logger, status, NULL, "Failed to add framework listener");
-
- return status;
+ return fw_addFrameworkListener(context->framework, context->bundle, listener);
}
celix_status_t bundleContext_removeFrameworkListener(bundle_context_pt context, framework_listener_pt listener) {