From 923589c5a145693bfd172fd9b211a50c3ab8f1b1 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 25 Apr 2014 16:09:15 +0200 Subject: [PATCH] core: Don't leak memory when shutting down the collector loop. Instead, put the current collector object back into the list in oder to keep a reference to it. --- src/core/plugin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/plugin.c b/src/core/plugin.c index d1f7541..dc3717b 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -1010,8 +1010,13 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop) errno = 0; } - if (! loop->do_loop) + if (! loop->do_loop) { + /* put back; don't worry about errors */ + sdb_llist_insert_sorted(collector_list, obj, + plugin_cmp_next_update); + sdb_object_deref(obj); return 0; + } } old_ctx = ctx_set(SDB_PLUGIN_CCB(obj)->ccb_ctx); -- 2.30.2