summaryrefslogtreecommitdiffstats
path: root/hw/ppc
diff options
context:
space:
mode:
authorDaniel Henrique Barboza2022-03-02 06:51:39 +0100
committerCédric Le Goater2022-03-02 06:51:39 +0100
commit37d1953448d58ac9313d4702913947f76c369338 (patch)
tree994d5495ddd0b4b5e9d4887c576c317b553f4ca9 /hw/ppc
parenthw/ppc/spapr_caps.c: use g_autofree in spapr_cap_get_string() (diff)
downloadqemu-37d1953448d58ac9313d4702913947f76c369338.tar.gz
qemu-37d1953448d58ac9313d4702913947f76c369338.tar.xz
qemu-37d1953448d58ac9313d4702913947f76c369338.zip
hw/ppc/spapr_caps.c: use g_autofree in spapr_caps_add_properties()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220228175004.8862-6-danielhb413@gmail.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_caps.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 2773f9db9e..655ab856a0 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -930,16 +930,13 @@ void spapr_caps_add_properties(SpaprMachineClass *smc)
for (i = 0; i < ARRAY_SIZE(capability_table); i++) {
SpaprCapabilityInfo *cap = &capability_table[i];
- char *name = g_strdup_printf("cap-%s", cap->name);
- char *desc;
+ g_autofree char *name = g_strdup_printf("cap-%s", cap->name);
+ g_autofree char *desc = g_strdup_printf("%s", cap->description);
object_class_property_add(klass, name, cap->type,
cap->get, cap->set,
NULL, cap);
- desc = g_strdup_printf("%s", cap->description);
object_class_property_set_description(klass, name, desc);
- g_free(name);
- g_free(desc);
}
}