From 429486953aeb4faa029313932cd4e0101741cb02 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 27 Sep 2025 15:55:19 +0000 Subject: [PATCH] Actually free the objects I don't know why I keep forgetting this. Signed-off-by: Michael Tremer --- src/daemon/ctx.c | 2 +- src/daemon/daemon.c | 1 + src/daemon/module.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/daemon/ctx.c b/src/daemon/ctx.c index 4f9296b..11820fe 100644 --- a/src/daemon/ctx.c +++ b/src/daemon/ctx.c @@ -49,7 +49,7 @@ static int collecty_ctx_setup_logging(collecty_ctx* ctx) { } static void collecty_ctx_free(collecty_ctx* ctx) { - return; + free(ctx); } int collecty_ctx_create(collecty_ctx** ctx) { diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 3dff76b..3f41aa0 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -227,6 +227,7 @@ static void collecty_daemon_free(collecty_daemon* self) { collecty_ctx_unref(self->ctx); if (self->loop) sd_event_unref(self->loop); + free(self); } int collecty_daemon_create(collecty_daemon** daemon, collecty_ctx* ctx) { diff --git a/src/daemon/module.c b/src/daemon/module.c index e56cf26..da1d45f 100644 --- a/src/daemon/module.c +++ b/src/daemon/module.c @@ -150,6 +150,7 @@ static void collecty_module_free(collecty_module* self) { collecty_daemon_unref(self->daemon); if (self->ctx) collecty_ctx_unref(self->ctx); + free(self); } int collecty_module_create(collecty_module** module, -- 2.47.3