osaf/libs/agents/saf/imma/imma_om_api.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


If the intialization of IMMA agen fails, then free the cl_node.

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -202,7 +202,7 @@ static SaAisErrorT initialize_common(SaI
        if (false == cb->is_immnd_up) {
                TRACE_2("ERR_TRY_AGAIN: IMMND is DOWN");
                rc = SA_AIS_ERR_TRY_AGAIN;
-               goto lock_fail;
+               goto end;
        }
 
        if((timeout_env_value = getenv("IMMA_SYNCR_TIMEOUT"))!=NULL) {
@@ -377,10 +377,6 @@ static SaAisErrorT initialize_common(SaI
 
  ipc_init_fail:
  lock_fail:
-       if (rc != SA_AIS_OK) {
-               free(cl_node);
-               cl_node=NULL;
-       }
 
        if (locked)
                m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
@@ -395,7 +391,7 @@ static SaAisErrorT initialize_common(SaI
                /* Went well, return immHandle to the application */
                *immHandle = cl_node->handle;
        }
-
+ end:
        if (rc != SA_AIS_OK) {
                if (NCSCC_RC_SUCCESS != imma_shutdown(NCSMDS_SVC_ID_IMMA_OM)) {
                        /* Oh boy. Failure in imma_shutdown when we already have
@@ -404,6 +400,10 @@ static SaAisErrorT initialize_common(SaI
 
                        rc = SA_AIS_ERR_LIBRARY;
                }
+               if (cl_node){
+                       free(cl_node);
+                       cl_node=NULL;
+               }
        }
 
        TRACE_LEAVE();

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to