From fb2b4fdb843c88ae5222271d498a17dec4d4ea8b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 20 Aug 2023 19:24:53 +0100 Subject: [Minor] Fix leak --- src/libserver/cfg_rcl.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libserver/cfg_rcl.cxx') diff --git a/src/libserver/cfg_rcl.cxx b/src/libserver/cfg_rcl.cxx index 310d89391..a20cd572d 100644 --- a/src/libserver/cfg_rcl.cxx +++ b/src/libserver/cfg_rcl.cxx @@ -68,6 +68,13 @@ struct rspamd_rcl_section { rspamd_rcl_section_fin_t fin{}; /** called at the end of section parsing */ gpointer fin_ud{}; ucl_object_t *doc_ref{}; /**< reference to the section's documentation */ + + virtual ~rspamd_rcl_section() + { + if (doc_ref) { + ucl_object_unref(doc_ref); + } + } }; struct rspamd_worker_param_parser { -- cgit v1.2.3