X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fsi%2Fsrc%2Frtable_si_static.c;h=f7cddf51fc9f225e3918aa6683e1653fd9222c89;hb=a344fdcdeb64f52a4f5c0e0c64e561c98a1e2890;hp=e0e3dc6d164155047e42a91b16220c40df362e36;hpb=5ec64c5253b3b7611ec69cc1487989fae45eca26;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 e0e3dc6..f7cddf5 100644 --- a/src/rmr/si/src/rtable_si_static.c +++ b/src/rmr/si/src/rtable_si_static.c @@ -177,12 +177,12 @@ extern endpoint_t* uta_add_ep( route_table_t* rt, rtable_ent_t* rte, char* ep_n } memset( rrg, 0, sizeof( *rrg ) ); - if( (rrg->epts = (endpoint_t **) malloc( sizeof( endpoint_t ) * MAX_EP_GROUP )) == NULL ) { + 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 ); + memset( rrg->epts, 0, sizeof( endpoint_t* ) * MAX_EP_GROUP ); rte->rrgroups[group] = rrg; @@ -224,12 +224,15 @@ static int uta_epsock_byname( uta_ctx_t* ctx, char* ep_name, int* nn_sock, endpo if( PARANOID_CHECKS ) { if( ctx == NULL ) { - if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: parinoia check pop ctx=%p\n", ctx, rt ); + if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: paranoia check pop ctx=%p rt=%p\n", ctx, rt ); return FALSE; } - rt = get_rt( ctx ); // get active rt and bump ref count - if( rt == NULL || (si_ctx = ctx->si_ctx) == NULL ) { - if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: parinoia check pop rt=%p sictx=%p\n", rt, si_ctx ); + if( (si_ctx = ctx->si_ctx) == NULL ) { + if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: paranoia check pop sictx is nil\n" ); + return FALSE; + } + if( (rt = get_rt( ctx )) == NULL ) { // get active rt and bump ref count + if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_byname: paranoia check pop no rtable\n" ); return FALSE; } } else {