diff mbox

[3/5] hw/ppc/spapr: Do not leak the memory of the type string

Message ID 1470734229-10832-4-git-send-email-thuth@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Huth Aug. 9, 2016, 9:17 a.m. UTC
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 <thuth@redhat.com>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

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);