aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunita Nadampalli2013-09-20 17:18:49 -0500
committerGerrit Code Review2013-09-24 16:36:36 -0500
commit4f74566a123093d4454c1d969ce340b33552e78b (patch)
treeca198856875e57f63c2131794e5130575f272713 /libdce.c
parent8ba74367a00526b8b79c25ab837bc542955cec3b (diff)
downloadrepo-libdce-4f74566a123093d4454c1d969ce340b33552e78b.tar.gz
repo-libdce-4f74566a123093d4454c1d969ce340b33552e78b.tar.xz
repo-libdce-4f74566a123093d4454c1d969ce340b33552e78b.zip
[LIBDCE] Fix memory leak on dce_ipc_init failure
On dce_ipc_init failure, we need to close the semaphore that was already created successfully. Change-Id: Id04ed4cae7e3dab6193e460b005580fac0c2edd4 Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Diffstat (limited to 'libdce.c')
-rw-r--r--libdce.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdce.c b/libdce.c
index ae8771e..06844cc 100644
--- a/libdce.c
+++ b/libdce.c
@@ -234,7 +234,7 @@ Engine_Handle Engine_open(String name, Engine_Attrs *attrs, Engine_Error *ec)
234 _ASSERT(dce_sem_wait(dce_semaphore) == DCE_EOK, DCE_ESEMAPHORE_FAIL); 234 _ASSERT(dce_sem_wait(dce_semaphore) == DCE_EOK, DCE_ESEMAPHORE_FAIL);
235 235
236 /* Initialize IPC. In case of Error Deinitialize them */ 236 /* Initialize IPC. In case of Error Deinitialize them */
237 _ASSERT_AND_EXECUTE(dce_ipc_init() == DCE_EOK, DCE_EIPC_CREATE_FAIL, dce_ipc_deinit()); 237 _ASSERT_AND_EXECUTE(dce_ipc_init() == DCE_EOK, DCE_EIPC_CREATE_FAIL, dce_sem_close(&dce_semaphore));
238 238
239 INFO(">> Engine_open Params::name = %s size = %d\n", name, strlen(name)); 239 INFO(">> Engine_open Params::name = %s size = %d\n", name, strlen(name));
240 /* Allocate Shared memory for the engine_open rpc msg structure*/ 240 /* Allocate Shared memory for the engine_open rpc msg structure*/