summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2016-05-27 09:33:27 +0200
committerChristian Hesse <mail@eworm.de>2016-05-27 09:33:27 +0200
commit85b78539c994984a6cbcc1095f126a1302db7808 (patch)
treebf361480d63e96015d5cb2c2ec76bd0a88a46af1 /src
parent5f056378b0ceffb6e6fba3513f7eae72e2d09dc8 (diff)
systemctl: fix code path (and memory leak) on error
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f4cdfa956e..86feefcb65 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5514,7 +5514,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) {
unit_file_dump_changes(r, verb, changes, n_changes, arg_quiet);
if (r < 0)
- return r;
+ goto finish;
r = 0;
} else {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL, *m = NULL;
@@ -5606,7 +5606,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) {
r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet, &changes, &n_changes);
if (r < 0)
- return r;
+ goto finish;
/* Try to reload if enabled */
if (!arg_no_reload)