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 3886f85a3df443ec4f0c62553be8af2c8217f758 Author: PengZheng <[email protected]> AuthorDate: Mon Apr 10 14:44:34 2023 +0800 Fix Coverity: dereference after null check (CID=16312). --- libs/framework/src/bundle.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libs/framework/src/bundle.c b/libs/framework/src/bundle.c index 74b0255e..d23113d8 100644 --- a/libs/framework/src/bundle.c +++ b/libs/framework/src/bundle.c @@ -442,17 +442,11 @@ celix_status_t bundle_getServicesInUse(bundle_pt bundle, array_list_pt *list) { } celix_status_t bundle_getFramework(const_bundle_pt bundle, framework_pt *framework) { - celix_status_t status = CELIX_SUCCESS; - - if (bundle != NULL && *framework == NULL) { - *framework = bundle->framework; - } else { - status = CELIX_ILLEGAL_ARGUMENT; - } - - framework_logIfError(bundle->framework->logger, status, NULL, "Failed to get framework"); - - return status; + if (bundle == NULL || framework == NULL) { + return CELIX_ILLEGAL_ARGUMENT; + } + *framework = bundle->framework; + return CELIX_SUCCESS; } celix_status_t bundle_getBundleLocation(const_bundle_pt bundle, const char **location){
