From 6e9a1923a7bacba51b61562133e098d62f779e44 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 22 Oct 2024 15:00:07 +0000 Subject: [PATCH] cli: daemon: Correctly catch daemon initialization errors Signed-off-by: Michael Tremer --- src/cli/lib/daemon.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/lib/daemon.c b/src/cli/lib/daemon.c index d54e5e74b..4dff6b8bb 100644 --- a/src/cli/lib/daemon.c +++ b/src/cli/lib/daemon.c @@ -31,10 +31,15 @@ int cli_daemon_main(struct pakfire_ctx* ctx) { // Create the daemon r = pakfire_daemon_create(&daemon, ctx); + if (r < 0) + goto ERROR; // Run the daemon r = pakfire_daemon_main(daemon); + if (r < 0) + goto ERROR; +ERROR: // Cleanup if (daemon) pakfire_daemon_unref(daemon); -- 2.39.5