aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/cfg_utils.c1
-rw-r--r--src/libutil/upstream.c6
-rw-r--r--src/libutil/upstream.h5
3 files changed, 12 insertions, 0 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 53ce5add4..b2e97564f 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -229,6 +229,7 @@ rspamd_config_free (struct rspamd_config *cfg)
g_list_free (cfg->metrics_list);
rspamd_symbols_cache_destroy (cfg->cache);
REF_RELEASE (cfg->libs_ctx);
+ rspamd_upstreams_library_unref (cfg->ups_ctx);
rspamd_mempool_delete (cfg->cfg_pool);
lua_close (cfg->lua_state);
g_slice_free1 (sizeof (*cfg), cfg);
diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c
index 5ef913f45..9ed483f18 100644
--- a/src/libutil/upstream.c
+++ b/src/libutil/upstream.c
@@ -139,6 +139,12 @@ rspamd_upstream_ctx_dtor (struct upstream_ctx *ctx)
g_slice_free1 (sizeof (*ctx), ctx);
}
+void
+rspamd_upstreams_library_unref (struct upstream_ctx *ctx)
+{
+ REF_RELEASE (ctx);
+}
+
struct upstream_ctx *
rspamd_upstreams_library_init (void)
{
diff --git a/src/libutil/upstream.h b/src/libutil/upstream.h
index a22a44589..eab2be368 100644
--- a/src/libutil/upstream.h
+++ b/src/libutil/upstream.h
@@ -28,6 +28,11 @@ struct upstream_ctx;
struct upstream_ctx* rspamd_upstreams_library_init (void);
/**
+ * Remove reference from upstreams library
+ */
+void rspamd_upstreams_library_unref (struct upstream_ctx *ctx);
+
+/**
* Configure attributes of upstreams library
* @param cfg
*/