diff options
author | Daniel Henrique Barboza | 2022-03-02 06:51:40 +0100 |
---|---|---|
committer | Cédric Le Goater | 2022-03-02 06:51:40 +0100 |
commit | 5436eee1aceff14e301fce6d2385cc253a3b6473 (patch) | |
tree | a353bd1257d9efaded27ca2368c06af01f7b7733 /hw/ppc | |
parent | hw/ppc/spapr_drc.c: use g_autofree in spapr_dr_connector_new() (diff) | |
download | qemu-5436eee1aceff14e301fce6d2385cc253a3b6473.tar.gz qemu-5436eee1aceff14e301fce6d2385cc253a3b6473.tar.xz qemu-5436eee1aceff14e301fce6d2385cc253a3b6473.zip |
hw/ppc/spapr_drc.c: use g_autofree in spapr_drc_by_index()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220228175004.8862-11-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr_drc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index ac4067625e..76bc5d42a0 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -798,11 +798,9 @@ static const TypeInfo spapr_drc_pmem_info = { SpaprDrc *spapr_drc_by_index(uint32_t index) { Object *obj; - gchar *name; - - name = g_strdup_printf("%s/%x", DRC_CONTAINER_PATH, index); + g_autofree gchar *name = g_strdup_printf("%s/%x", DRC_CONTAINER_PATH, + index); obj = object_resolve_path(name, NULL); - g_free(name); return !obj ? NULL : SPAPR_DR_CONNECTOR(obj); } |