X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fsi%2Fsrc%2Frtable_si_static.c;h=f929295c5a297364bec5386ed5cade74d781631d;hb=fcea3951d44de0cc55d33c5e114487abe79d3406;hp=0f796e31373a3b5abfdbba3757fe9662af87af9e;hpb=009378503e4621ab53f0839a409563b4a03e100f;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/si/src/rtable_si_static.c b/src/rmr/si/src/rtable_si_static.c index 0f796e3..f929295 100644 --- a/src/rmr/si/src/rtable_si_static.c +++ b/src/rmr/si/src/rtable_si_static.c @@ -180,6 +180,7 @@ extern endpoint_t* uta_add_ep( route_table_t* rt, rtable_ent_t* rte, char* ep_n if( (rrg->epts = (endpoint_t **) malloc( sizeof( endpoint_t ) * MAX_EP_GROUP )) == NULL ) { rmr_vlog( RMR_VL_WARN, "rmr_add_ep: malloc failed for group endpoint array: group=%d\n", group ); + free( rrg ); return NULL; } memset( rrg->epts, 0, sizeof( endpoint_t ) * MAX_EP_GROUP ); @@ -218,13 +219,14 @@ extern endpoint_t* uta_add_ep( route_table_t* rt, rtable_ent_t* rte, char* ep_n endpoint cannot be found false (0) is returned. */ static int uta_epsock_byname( uta_ctx_t* ctx, char* ep_name, int* nn_sock, endpoint_t** uepp ) { - route_table_t* rt; + route_table_t* rt = NULL; si_ctx_t* si_ctx; endpoint_t* ep; int state = FALSE; - if( PARINOID_CHECKS ) { + if( PARANOID_CHECKS ) { if( ctx == NULL || (rt = ctx->rtable) == NULL || (si_ctx = ctx->si_ctx) == NULL ) { + if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: parinoia check pop ctx=%p rt=%p\n", ctx, rt ); return FALSE; } } else { @@ -233,6 +235,7 @@ static int uta_epsock_byname( uta_ctx_t* ctx, char* ep_name, int* nn_sock, endpo } ep = rmr_sym_get( rt->hash, ep_name, 1 ); + if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: ep not found: %s\n", ep_name ); if( uepp != NULL ) { // caller needs endpoint too, give it back *uepp = ep; } @@ -297,7 +300,7 @@ static int uta_epsock_rr( uta_ctx_t* ctx, rtable_ent_t* rte, int group, int* mor rrgroup_t* rrg; int idx; - if( PARINOID_CHECKS ) { + if( PARANOID_CHECKS ) { if( ctx == NULL || (si_ctx = ctx->si_ctx) == NULL ) { return FALSE; } @@ -401,7 +404,7 @@ static int epsock_meid( uta_ctx_t* ctx, route_table_t *rtable, rmr_mbuf_t* msg, char* meid; si_ctx_t* si_ctx; - if( PARINOID_CHECKS ) { + if( PARANOID_CHECKS ) { if( ctx == NULL || (si_ctx = ctx->si_ctx) == NULL ) { return FALSE; }