]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove bad asserts
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 31 Dec 2020 12:45:01 +0000 (12:45 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 31 Dec 2020 12:46:04 +0000 (12:46 +0000)
src/lib/io/schedule.c

index 0335e2316bdbd242e1629ee82b9c368795053b16..1cff99184eb8ff98ad5b87ee40406464d96bc47c 100644 (file)
@@ -692,6 +692,10 @@ fr_schedule_t *fr_schedule_create(TALLOC_CTX *ctx, fr_event_list_t *el,
 }
 
 /** Destroy a scheduler, and tell its child threads to exit.
+ *
+ * @note This may be called with no worker or network threads in the case of a
+ *      instantiation error.  This function _should_ deal with that condition
+ *      gracefully.
  *
  * @param[in] sc_to_free the scheduler
  * @return
@@ -722,9 +726,6 @@ int fr_schedule_destroy(fr_schedule_t **sc_to_free)
                goto done;
        }
 
-       if (!fr_cond_assert(fr_dlist_num_elements(&sc->networks) > 0)) return -1;
-       if (!fr_cond_assert(fr_dlist_num_elements(&sc->workers) > 0)) return -1;
-
        /*
         *      Signal each network thread to exit.
         */