aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-08-20 19:44:57 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-08-20 19:45:23 +0100
commit1931487b17059d6c63adf2245c9632384657f89e (patch)
treef0b7a06ee3452f9c658dbcbaf9a8a2977e0a8f65
parentfb2b4fdb843c88ae5222271d498a17dec4d4ea8b (diff)
downloadrspamd-1931487b17059d6c63adf2245c9632384657f89e.tar.gz
rspamd-1931487b17059d6c63adf2245c9632384657f89e.zip
[Minor] Another leak
-rw-r--r--src/fuzzy_storage.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 21c5c271e..23a4f45cd 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -2227,7 +2227,7 @@ rspamd_fuzzy_maybe_load_ratelimits(struct rspamd_fuzzy_storage_ctx *ctx)
if (access(path, R_OK) != -1) {
struct ucl_parser *parser = ucl_parser_new(UCL_PARSER_NO_IMPLICIT_ARRAYS | UCL_PARSER_DISABLE_MACRO);
if (ucl_parser_add_file(parser, path)) {
- const ucl_object_t *obj = ucl_parser_get_object(parser);
+ ucl_object_t *obj = ucl_parser_get_object(parser);
int loaded = 0;
if (ucl_object_type(obj) == UCL_ARRAY) {
@@ -2274,11 +2274,13 @@ rspamd_fuzzy_maybe_load_ratelimits(struct rspamd_fuzzy_storage_ctx *ctx)
}
}
- ucl_parser_free(parser);
-
msg_info("loaded %d ratelimit objects", loaded);
}
+
+ ucl_object_unref(obj);
}
+
+ ucl_parser_free(parser);
}
}