From: Arran Cudbard-Bell Date: Thu, 31 Dec 2020 12:45:01 +0000 (+0000) Subject: Remove bad asserts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfe31c0721d2a6ce57e67df4733a1a169fc7b3bf;p=thirdparty%2Ffreeradius-server.git Remove bad asserts --- diff --git a/src/lib/io/schedule.c b/src/lib/io/schedule.c index 0335e2316bd..1cff99184eb 100644 --- a/src/lib/io/schedule.c +++ b/src/lib/io/schedule.c @@ -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. */