cfg: Free new_config interfaces on failure

new_config interfaces was freed on success, but not if some previous
configuration step failed.

Solution is to move free of interfaces to same point as where
orig_interfaces are freed.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
This commit is contained in:
Jan Friesse 2024-08-21 17:57:31 +02:00
parent 53730fa7bd
commit b71b8f9dbf

View File

@ -827,7 +827,6 @@ static void message_handler_req_exec_cfg_reload_config (
/* Copy into live system */
totempg_put_config(&new_config);
totemconfig_commit_new_params(&new_config, temp_map);
free(new_config.interfaces);
reload_fini:
/* All done - let clients know */
@ -836,6 +835,7 @@ reload_fini:
icmap_set_uint8("config.reload_in_progress", 0);
/* Finished with the temporary storage */
free(new_config.interfaces);
free(new_config.orig_interfaces);
reload_fini_nofree: