X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Frmr%2Fsi%2Fsrc%2Frtable_si_static.c;fp=src%2Frmr%2Fsi%2Fsrc%2Frtable_si_static.c;h=117cfc9565daa8ea90ccafb7b392d41ef7feb7ff;hb=bf897297010df539909b7638d96557d41fd217b0;hp=6215176a87d3dc47223c0d76bf77fc43702b013d;hpb=99584a241c64d29fc20e74a4b4e01427d0f00e73;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 6215176..117cfc9 100644 --- a/src/rmr/si/src/rtable_si_static.c +++ b/src/rmr/si/src/rtable_si_static.c @@ -394,6 +394,8 @@ static int uta_epsock_rr( uta_ctx_t* ctx, rtable_ent_t* rte, int group, int* mor We've been told that the meid is a string, thus we count on it being a nil terminated set of bytes. + + If we return false the caller's ep reference may NOT be valid or even nil. */ static int epsock_meid( uta_ctx_t* ctx, route_table_t *rtable, rmr_mbuf_t* msg, int* nn_sock, endpoint_t** uepp ) { endpoint_t* ep; // seected end point @@ -417,11 +419,12 @@ static int epsock_meid( uta_ctx_t* ctx, route_table_t *rtable, rmr_mbuf_t* msg, meid = ((uta_mhdr_t *) msg->header)->meid; - if( (ep = get_meid_owner( rtable, meid )) == NULL ) { - if( uepp != NULL ) { // caller needs refernce to endpoint too - *uepp = NULL; - } + ep = get_meid_owner( rtable, meid ); + if( uepp != NULL ) { // caller needs refernce to endpoint too + *uepp = ep; + } + if( ep == NULL ) { if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "epsock_meid: no ep in hash for (%s)\n", meid ); return FALSE; }