]> git.proxmox.com Git - mirror_qemu.git/commit
hw/riscv/virt.c: use g_autofree in create_fdt_*
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Mon, 22 Jan 2024 22:15:29 +0000 (19:15 -0300)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 9 Feb 2024 10:43:14 +0000 (20:43 +1000)
commit5fb20f76008e13f99ec42867f4ebd4089b71ba96
treed9aced3af676575b20862921d44d0726103184ba
parentc70dc31f3010931e700e4786e2a3d8ab474c6a05
hw/riscv/virt.c: use g_autofree in create_fdt_*

We have a lot of cases where a char or an uint32_t pointer is used once
to alloc a string/array, read/written during the function, and then
g_free() at the end. There's no pointer re-use - a single alloc, a
single g_free().

Use 'g_autofree' to avoid the g_free() calls.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240122221529.86562-8-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/virt.c