mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
7614114e90
commit
5436eee1ac
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue