aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-22 09:52:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-22 10:57:29 +0100
commit28e34a75931d363e7e85619368fa5c43f606e7d9 (patch)
treeea219d9456516dea7c3be1683d58b1e058a9efe4
parenta0f2a047af123e227934b6777065c98438024dde (diff)
downloadrspamd-28e34a75931d363e7e85619368fa5c43f606e7d9.tar.gz
rspamd-28e34a75931d363e7e85619368fa5c43f606e7d9.zip
[Minor] Add assertions to prevent scheduling of uninitialised watcherslibev-migration
-rw-r--r--src/libutil/libev_helper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/libev_helper.c b/src/libutil/libev_helper.c
index 8a2cdc677..81a23dea6 100644
--- a/src/libutil/libev_helper.c
+++ b/src/libutil/libev_helper.c
@@ -64,6 +64,8 @@ rspamd_ev_watcher_start (struct ev_loop *loop,
struct rspamd_io_ev *ev,
ev_tstamp timeout)
{
+ g_assert (ev->cb != NULL);
+
ev->last_activity = ev_now (EV_A);
ev_io_start (EV_A_ &ev->io);
@@ -92,6 +94,8 @@ rspamd_ev_watcher_reschedule (struct ev_loop *loop,
struct rspamd_io_ev *ev,
short what)
{
+ g_assert (ev->cb != NULL);
+
if (ev_is_pending (&ev->io) || ev_is_active (&ev->io)) {
ev_io_stop (EV_A_ &ev->io);
ev_io_set (&ev->io, ev->io.fd, what);