Add first set of SI95 unit tests and health check
[ric-plt/lib/rmr.git] / src / rmr / common / src / symtab.c
index 43acfa1..a105187 100644 (file)
@@ -313,7 +313,7 @@ extern void rmr_sym_del( void *vtable, const char *name, unsigned int class )
 /*
        Delete element by numberic key.
 */
-extern void *rmr_sym_ndel(  void *vtable, uint64_t key ) {
+extern void rmr_sym_ndel(  void *vtable, uint64_t key ) {
        rmr_sym_del( vtable, (const char *) &key, 0 );
 }
 
@@ -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 );
+                                       }
                                }
                        }
 }