core: move reset_arguments() to the end of main's finish
authorAnita Zhang <the.anitazha@gmail.com>
Thu, 17 Sep 2020 08:49:17 +0000 (01:49 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Dec 2020 13:36:56 +0000 (14:36 +0100)
commitbad8c93f80bf4554c93dc941c0fe10188c380a59
tree0881eac77c8e7bee20a89f57851669afb83dc5c8
parentbf48192af5d644ff6817d2b4279e0dbf5f9212b8
core: move reset_arguments() to the end of main's finish

Fixes #16991

fb39af4ce42d7ef9af63009f271f404038703704 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.

(cherry picked from commit 7d9eea2bd3d4f83668c7a78754d201b226acbf1e)
src/core/main.c