aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2015-12-28 17:38:26 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2016-01-11 15:29:05 +1100
commit87bbdd9cafe58ce50d462307394d51af98d50d74 (patch)
treef36f5dfb8aefb4bd9fa8024f630c2dabbc6cddd9 /hw
parent215e209846d37a2e4b3e2de1f901e808837480dd (diff)
hw/ppc/spapr: fix spapr->kvm_type leak
Cc: David Gibson <david@gibson.dropbear.id.au> Cc: Alexander Graf <agraf@suse.de> Cc: qemu-ppc@nongnu.org Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> [fixed return type of spapr_machine_finalizefn()] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/spapr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 580b75da9c..414e0f9b7a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2108,6 +2108,13 @@ static void spapr_machine_initfn(Object *obj)
NULL);
}
+static void spapr_machine_finalizefn(Object *obj)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(obj);
+
+ g_free(spapr->kvm_type);
+}
+
static void ppc_cpu_do_nmi_on_cpu(void *arg)
{
CPUState *cs = arg;
@@ -2302,6 +2309,7 @@ static const TypeInfo spapr_machine_info = {
.abstract = true,
.instance_size = sizeof(sPAPRMachineState),
.instance_init = spapr_machine_initfn,
+ .instance_finalize = spapr_machine_finalizefn,
.class_size = sizeof(sPAPRMachineClass),
.class_init = spapr_machine_class_init,
.interfaces = (InterfaceInfo[]) {