From: Vsevolod Stakhov Date: Thu, 29 Aug 2019 12:07:47 +0000 (+0100) Subject: [Minor] Add special assertions to avoid upstreams corruption X-Git-Tag: 2.0~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdb077d507c91d60dbcbdadd206cfe6495cef4c1;p=thirdparty%2Frspamd.git [Minor] Add special assertions to avoid upstreams corruption --- diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index 1777310386..0637a0ac1b 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -450,6 +450,7 @@ rspamd_upstream_revive_cb (struct ev_loop *loop, ev_timer *w, int revents) } RSPAMD_UPSTREAM_UNLOCK (upstream->lock); + g_assert (upstream->ref.refcount > 1); REF_RELEASE (upstream); } @@ -1045,6 +1046,7 @@ rspamd_upstream_restore_cb (gpointer elt, gpointer ls) } /* For revive event */ + g_assert (up->ref.refcount > 1); REF_RELEASE (up); }