celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1651624 - /celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c
Date Wed, 14 Jan 2015 11:41:28 GMT
Author: bpetri
Date: Wed Jan 14 11:41:28 2015
New Revision: 1651624

URL: http://svn.apache.org/r1651624
Log:

CELIX-190: fixed minor memory leak


Modified:
    celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c

Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c?rev=1651624&r1=1651623&r2=1651624&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c
(original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c
Wed Jan 14 11:41:28 2015
@@ -34,6 +34,7 @@
 
 struct activator {
 	remote_service_admin_pt admin;
+	remote_service_admin_service_pt adminService;
 	service_registration_pt registration;
 };
 
@@ -61,7 +62,6 @@ celix_status_t bundleActivator_start(voi
 
 	status = remoteServiceAdmin_create(context, &activator->admin);
 	if (status == CELIX_SUCCESS) {
-		// TODO: free
 		remoteServiceAdmin = calloc(1, sizeof(*remoteServiceAdmin));
 		if (!remoteServiceAdmin) {
 			status = CELIX_ENOMEM;
@@ -88,6 +88,7 @@ celix_status_t bundleActivator_start(voi
 			remoteServiceAdmin->importRegistration_getImportReference = importRegistration_getImportReference;
 
 			status = bundleContext_registerService(context, OSGI_RSA_REMOTE_SERVICE_ADMIN, remoteServiceAdmin,
NULL, &activator->registration);
+			activator->adminService = remoteServiceAdmin;
 		}
 	}
 
@@ -102,6 +103,7 @@ celix_status_t bundleActivator_stop(void
 	serviceRegistration_unregister(activator->registration);
 	activator->registration = NULL;
 
+	free(activator->adminService);
 
 	return status;
 }



Mime
View raw message