celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From griccia...@apache.org
Subject celix git commit: CELIX-363: Fixed leak in exportRegistration_create DFI
Date Thu, 02 Jun 2016 13:59:47 GMT
Repository: celix
Updated Branches:
  refs/heads/develop feea43ed7 -> 5947def45


CELIX-363: Fixed leak in exportRegistration_create DFI


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5947def4
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5947def4
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5947def4

Branch: refs/heads/develop
Commit: 5947def45f67ec974e5dd736efc14b94985dca2b
Parents: feea43e
Author: lele.ricciardi <lele.ricciardi@gmail.com>
Authored: Thu Jun 2 15:45:29 2016 +0200
Committer: lele.ricciardi <lele.ricciardi@gmail.com>
Committed: Thu Jun 2 15:45:29 2016 +0200

----------------------------------------------------------------------
 .../rsa/private/src/export_registration_dfi.c             | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/5947def4/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
b/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
index a8d61ff..1cfcf16 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
@@ -105,7 +105,15 @@ celix_status_t exportRegistration_create(log_helper_pt helper, service_reference
             /* Add the interface version as a property in the properties_map */
             char* intfVersion = NULL;
             dynInterface_getVersionString(reg->intf, &intfVersion);
-            properties_set(endpoint->properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION,
intfVersion);
+            char *serviceVersion = properties_get(endpoint->properties,(char*) CELIX_FRAMEWORK_SERVICE_VERSION);
+            if(serviceVersion!=NULL){
+            	if(strcmp(serviceVersion,intfVersion)!=0){
+            		logHelper_log(helper, OSGI_LOGSERVICE_WARNING, "Service version (%s) and interface
version from the descriptor (%s) are not the same!",serviceVersion,intfVersion);
+            	}
+            }
+            else{
+            	properties_set(endpoint->properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION,
intfVersion);
+            }
         }
     } 
 


Mime
View raw message