When the launchctl_boot_plist() function was added in a16eb6b1ff3 (maintenance: skip bootout/bootstrap when plist is registered, 2021-08-24), an unused call to launchctl_get_uid() was added along with it. That call appears to have been copy/pasted from launchctl_boot_plist(). Since we can remove that, we can also get rid of the "result" variable, whose only purpose was allow for the free() between its assignment and the return. That pattern also appears to have been copy/pasted from launchctl_boot_plist(). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> --- I happen to have a local topic that refactored the launchctl_get_uid() function away, that didn't compile with the updated "master", I figured I'd need to add it back since it had a new user, but as it turns out that hopefully won't be needed. builtin/gc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 9a48eb535fb..b024f0e04e9 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -1602,9 +1602,7 @@ static int launchctl_remove_plists(const char *cmd) static int launchctl_list_contains_plist(const char *name, const char *cmd) { - int result; struct child_process child = CHILD_PROCESS_INIT; - char *uid = launchctl_get_uid(); strvec_split(&child.args, cmd); strvec_pushl(&child.args, "list", name, NULL); @@ -1615,12 +1613,8 @@ static int launchctl_list_contains_plist(const char *name, const char *cmd) if (start_command(&child)) die(_("failed to start launchctl")); - result = finish_command(&child); - - free(uid); - /* Returns failure if 'name' doesn't exist. */ - return !result; + return !finish_command(&child); } static int launchctl_schedule_plist(const char *exec_path, enum schedule_priority schedule, const char *cmd) -- 2.33.0.825.gdc3f7a2a6c7