diff options
author | Daniel Henrique Barboza <danielhb413@gmail.com> | 2022-03-02 06:51:40 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2022-03-02 06:51:40 +0100 |
commit | 5436eee1aceff14e301fce6d2385cc253a3b6473 (patch) | |
tree | a353bd1257d9efaded27ca2368c06af01f7b7733 /hw | |
parent | 7614114e903cf6fe485772c3432ccc36568e8ab3 (diff) |
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')
-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); } |