1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-31 14:50:15 +03:00

core: Fix memory leaks

arg_early_core_pattern and arg_watchdog_device hold pointers to memory
allocated with strdup() (inside path_make_absolute_cwd). The memory needs
to be freed in reset_arguments() during reload rather than forgotten.
This commit is contained in:
Łukasz Stelmach 2022-06-21 12:12:01 +02:00 committed by Luca Boccassi
parent f304d03884
commit 919ea64f69

View File

@ -2377,8 +2377,8 @@ static void reset_arguments(void) {
arg_reboot_watchdog = 10 * USEC_PER_MINUTE;
arg_kexec_watchdog = 0;
arg_pretimeout_watchdog = 0;
arg_early_core_pattern = NULL;
arg_watchdog_device = NULL;
arg_early_core_pattern = mfree(arg_early_core_pattern);
arg_watchdog_device = mfree(arg_watchdog_device);
arg_watchdog_pretimeout_governor = mfree(arg_watchdog_pretimeout_governor);
arg_default_environment = strv_free(arg_default_environment);