diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-30 13:10:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-30 13:10:57 +0100 |
commit | 8d271079beaf5c6e69eced2a234f59a83208717e (patch) | |
tree | 80ffdb958a36a1005df97dfebd7a27826897d9a5 | |
parent | f0823abc0076d78ee492e0b2c8d1a1b7921adaec (diff) | |
download | rspamd-8d271079beaf5c6e69eced2a234f59a83208717e.tar.gz rspamd-8d271079beaf5c6e69eced2a234f59a83208717e.zip |
[Minor] Fix minor memory leak on saving stats
-rw-r--r-- | src/controller.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/controller.c b/src/controller.c index a9b5ab991..0f415210c 100644 --- a/src/controller.c +++ b/src/controller.c @@ -3172,6 +3172,7 @@ rspamd_controller_store_saved_stats (struct rspamd_controller_worker_ctx *ctx) { struct rspamd_stat *stat; ucl_object_t *top, *sub; + struct ucl_emitter_functions *efuncs; gint i, fd; g_assert (ctx->saved_stats_path != NULL); @@ -3217,12 +3218,14 @@ rspamd_controller_store_saved_stats (struct rspamd_controller_worker_ctx *ctx) "control_connections", 0, false); + efuncs = ucl_object_emit_fd_funcs (fd); ucl_object_emit_full (top, UCL_EMIT_JSON_COMPACT, - ucl_object_emit_fd_funcs (fd), NULL); + efuncs, NULL); ucl_object_unref (top); rspamd_file_unlock (fd, FALSE); close (fd); + ucl_object_emit_funcs_free (efuncs); } static void |