qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/5] hw/ppc/spapr: Do not leak the memory of the typ


From: Thomas Huth
Subject: [Qemu-devel] [PATCH 3/5] hw/ppc/spapr: Do not leak the memory of the type string
Date: Tue, 9 Aug 2016 11:17:07 +0200

The type string is allocated in spapr_get_cpu_core_type()
with g_strdup_printf(), so we should free this memory when we're
done with it.

Signed-off-by: Thomas Huth <address@hidden>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ec65b07..424b506 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1840,6 +1840,7 @@ static void ppc_spapr_init(MachineState *machine)
                 object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID,
                                         &error_fatal);
                 object_property_set_bool(core, true, "realized", &error_fatal);
+                g_free(type);
             }
         }
         g_free(type);
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]