summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-18 00:53:06 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-18 00:53:09 +0100
commitd54110d11d5ea3381cfdd129356b91669b547216 (patch)
tree77a3b2e0e03751935637f50b73efd7df0eb686c8
parent52a2ab41e029728ef0a4303d7aafc9d47f116004 (diff)
systemctl: it's probably a good idea not to alter return parameters if we fail
We generally follow the rule not to touch return values unless we succeed, so for the sake of uniformity do the same here.
-rw-r--r--src/systemctl/systemctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index de1a022ae3..cac70673c8 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -842,8 +842,9 @@ static int list_dependencies_get_dependencies(DBusConnection *bus, const char *n
}
finish:
if (r < 0)
- strv_freep(&ret);
- *deps = ret;
+ strv_free(ret);
+ else
+ *deps = ret;
return r;
}