chiark / gitweb /
systemctl: it's probably a good idea not to alter return parameters if we fail
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Jan 2013 23:53:06 +0000 (00:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 17 Jan 2013 23:53:09 +0000 (00:53 +0100)
We generally follow the rule not to touch return values unless we
succeed, so for the sake of uniformity do the same here.

src/systemctl/systemctl.c

index de1a022ae36174e19f4372bcab2da35c10390876..cac70673c8b81a0830035e04018329b6acc328f1 100644 (file)
@@ -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;
 }