From: Michael Tremer Date: Tue, 22 Oct 2024 15:00:07 +0000 (+0000) Subject: cli: daemon: Correctly catch daemon initialization errors X-Git-Tag: 0.9.30~955 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e9a1923a7bacba51b61562133e098d62f779e44;p=pakfire.git cli: daemon: Correctly catch daemon initialization errors Signed-off-by: Michael Tremer --- 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);