core: move reset_arguments() to the end of main's finish

Fixes #16991

fb39af4ce4 replaced `free_arguments()` with
`reset_arguments()`, which frees arg_* variables as before, but also resets all
of them to the default values. `reset_arguments()` was positioned
in such a way that it overrode some arg_* values still in use at shutdown.

To avoid further unintentional resets, I moved `reset_arguments()`
right before the return, when nothing else will be using the arg_* variables.
This commit is contained in:
Anita Zhang 2020-09-17 01:49:17 -07:00 committed by Zbigniew Jędrzejewski-Szmek
parent e535434d47
commit 7d9eea2bd3
1 changed files with 2 additions and 1 deletions

View File

@ -2868,7 +2868,6 @@ finish:
m = manager_free(m);
}
reset_arguments();
mac_selinux_finish();
if (reexecute)
@ -2895,6 +2894,7 @@ finish:
* in become_shutdown() so normally we cannot free them yet. */
watchdog_free_device();
arg_watchdog_device = mfree(arg_watchdog_device);
reset_arguments();
return retval;
}
#endif
@ -2920,5 +2920,6 @@ finish:
freeze_or_exit_or_reboot();
}
reset_arguments();
return retval;
}