hw/ppc/spapr_drc.c: use g_auto in spapr_dt_drc()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 2 Mar 2022 05:51:39 +0000 (06:51 +0100)
committerCédric Le Goater <clg@kaod.org>
Wed, 2 Mar 2022 05:51:39 +0000 (06:51 +0100)
commit75610acfd3cb9260c0f2fe45492f81d637bfd62c
tree204e0e86a702719d2fd921848176579e1f5d1631
parent37d1953448d58ac9313d4702913947f76c369338
hw/ppc/spapr_drc.c: use g_auto in spapr_dt_drc()

Use g_autoptr() with GArray* and GString* pointers to avoid calling
g_free() and the need for the 'out' label.

'drc_name' can also be g_autofreed to avoid a g_free() call at the end
of the while() loop.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220228175004.8862-7-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/ppc/spapr_drc.c