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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user