Re: [PATCH 7/7] hw/riscv/virt.c: use g_autofree in create_fdt_*

2024-02-04 Thread Alistair Francis
On Tue, Jan 23, 2024 at 8:18 AM Daniel Henrique Barboza wrote: > > 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().

[PATCH 7/7] hw/riscv/virt.c: use g_autofree in create_fdt_*

2024-01-22 Thread Daniel Henrique Barboza
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