]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
cleanups for CID #1597277 and CID #1597276
authorAlan T. DeKok <aland@freeradius.org>
Sat, 11 May 2024 00:04:13 +0000 (20:04 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 11 May 2024 00:04:13 +0000 (20:04 -0400)
delete assert, as the loop over "mi" doesn't change "a" or "b"

make the "if" conditions for early exit a little clearer

src/lib/server/module.c

index 4046180e7f0112c63cb7b84050a79951ca820984..3b1a5a8a3857fe325a8468f269df29aae3f1d63c 100644 (file)
@@ -420,8 +420,11 @@ static void mlg_data_del(module_instance_t *mi)
 {
        mlg_module_instance_t   *mlg_mi = (mlg_module_instance_t *)talloc_get_type_abort(mi, module_instance_t);
 
-       if (fr_heap_entry_inserted(mlg_mi->inst_idx) && !fr_cond_assert(fr_heap_extract(&mlg_index, mi) == 0)) return;
-       return;
+       if (!fr_heap_entry_inserted(mlg_mi->inst_idx)) return;
+       
+       if (fr_heap_extract(&mlg_index, mi) == 0) return;
+
+       fr_assert(0);
 }
 
 /** Free the thread local heap on exit
@@ -691,15 +694,6 @@ static int8_t module_instance_name_cmp(void const *one, void const *two)
        ret = CMP(a_depth, b_depth);
        if (ret != 0) return ret;
 
-       /*
-        *      This happens, as mi is is used in
-        *      as the loop condition above.
-        */
-#ifdef STATIC_ANALYZER
-       if (!fr_cond_assert(a)) return +1;
-       if (!fr_cond_assert(b)) return -1;
-#endif
-
        ret = CMP(a->parent, b->parent);
        if (ret != 0) return ret;