From: Lennart Poettering Date: Thu, 17 Jan 2013 23:53:06 +0000 (+0100) Subject: systemctl: it's probably a good idea not to alter return parameters if we fail X-Git-Tag: v198~487 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d54110d11d5ea3381cfdd129356b91669b547216;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index de1a022ae36..cac70673c8b 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; }