celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject [1/2] celix git commit: CELIX-301: fix memory leaks in rsa_shm
Date Fri, 20 Nov 2015 07:24:57 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 4b85f425a -> 77b8e711f


CELIX-301: fix memory leaks in rsa_shm


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

Branch: refs/heads/develop
Commit: eac117a4ce909e4575410d3c8e7390ceb37b2e7a
Parents: d72713e
Author: Bjoern Petri <bpetri@apache.org>
Authored: Fri Nov 20 08:23:48 2015 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Fri Nov 20 08:23:48 2015 +0100

----------------------------------------------------------------------
 .../private/src/remote_service_admin_impl.c                        | 2 ++
 .../private/test/rsa_client_server_tests.cpp                       | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/eac117a4/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
b/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
index c9771b0..385e9be 100644
--- a/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
+++ b/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
@@ -190,6 +190,7 @@ celix_status_t remoteServiceAdmin_stop(remote_service_admin_pt admin)
{
     while (hashMapIterator_hasNext(iter)) {
         ipc_segment_pt ipc = hashMapIterator_nextValue(iter);
         remoteServiceAdmin_deleteIpcSegment(ipc);
+        free(ipc);
     }
     hashMapIterator_destroy(iter);
 
@@ -337,6 +338,7 @@ static void * remoteServiceAdmin_receiveFromSharedMemory(void *data) {
                                 } else {
                                     strcpy(ipc->shmBaseAdress, reply);
                                 }
+                                free(reply);
                             }
                         } else {
                             logHelper_log(admin->loghelper, OSGI_LOGSERVICE_ERROR, "receiveFromSharedMemory
: No endpoint set for %s.", export->endpointDescription->service);

http://git-wip-us.apache.org/repos/asf/celix/blob/eac117a4/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
b/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
index e15c74a..1c10c72 100644
--- a/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
+++ b/remote_services/remote_service_admin_shm/private/test/rsa_client_server_tests.cpp
@@ -94,7 +94,7 @@ static void test1(void) {
     celix_status_t status = CELIX_BUNDLE_EXCEPTION;
     service_reference_pt ref = NULL;
     calculator_service_pt calcService = NULL;
-    int retries = 24;
+    int retries = 12;
 
     while (ref == NULL && retries > 0) {
     	printf("Waiting for service .. %d\n", retries);


Mime
View raw message