From aebb9b9cb2738c2a0b21c7315822fac7d9bb5004 Mon Sep 17 00:00:00 2001 From: Daniel Henrique Barboza Date: Wed, 2 Mar 2022 06:51:39 +0100 Subject: hw/ppc/spapr.c: use g_autofree in spapr_dt_chosen() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Henrique Barboza Reviewed-by: David Gibson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220228175004.8862-2-danielhb413@gmail.com> Signed-off-by: Cédric Le Goater --- hw/ppc/spapr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f0b75b22bb..c74543ace3 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1018,9 +1018,9 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset) if (reset) { const char *boot_device = spapr->boot_device; - char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); + g_autofree char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); size_t cb = 0; - char *bootlist = get_boot_devices_list(&cb); + g_autofree char *bootlist = get_boot_devices_list(&cb); if (machine->kernel_cmdline && machine->kernel_cmdline[0]) { _FDT(fdt_setprop_string(fdt, chosen, "bootargs", @@ -1087,9 +1087,6 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset) } spapr_dt_ov5_platform_support(spapr, fdt, chosen); - - g_free(stdout_path); - g_free(bootlist); } _FDT(spapr_dt_ovec(fdt, chosen, spapr->ov5_cas, "ibm,architecture-vec-5")); -- cgit v1.2.3