]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add special assertions to avoid upstreams corruption
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Aug 2019 12:07:47 +0000 (13:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Aug 2019 12:07:47 +0000 (13:07 +0100)
src/libutil/upstream.c

index 17773103868eba2c6620ace3ec3c994d3931bcf9..0637a0ac1b8c7464f3b5337311006c19ad8827ba 100644 (file)
@@ -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);
 }