X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Fsrc%2Fsymtab.c;h=a105187b857b5052f6deaaf92453fff0d3189527;hb=refs%2Ftags%2F3.3.0;hp=8b94a41e81cac9ed11816381639ad27425efb9f5;hpb=6b1712a0f1c2fb37eec04b3114ce1956800f74c9;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/src/symtab.c b/src/rmr/common/src/symtab.c index 8b94a41..a105187 100644 --- a/src/rmr/common/src/symtab.c +++ b/src/rmr/common/src/symtab.c @@ -470,11 +470,13 @@ extern void rmr_sym_foreach_class( void *vst, unsigned int class, void (* user_f if( st && (list = st->symlist) != NULL && user_fun != NULL ) for( i = 0; i < st->size; i++ ) - for( se = list[i]; se; se = next ) /* using next allows user to delet via this */ + for( se = list[i]; se; se = next ) /* using next allows user to delete via this */ { - next = se->next; - if( class == se->class ) { - user_fun( st, se, se->name, se->val, user_data ); + if( se ) { + next = se->next; + if( class == se->class ) { + user_fun( st, se, se->name, se->val, user_data ); + } } } }