kvm_set_device allocates device via g_strdup, but no
instance_finalize existed for the KVM accelerator type.
Fixes: aef158b093b9 ("Add class property to configure KVM device node to use")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
kvm_arch_accel_class_init(oc);
}
+static void kvm_accel_finalize(Object *obj)
+{
+ KVMState *s = KVM_STATE(obj);
+
+ g_free(s->device);
+}
+
static const TypeInfo kvm_accel_type = {
.name = TYPE_KVM_ACCEL,
.parent = TYPE_ACCEL,
.instance_init = kvm_accel_instance_init,
+ .instance_finalize = kvm_accel_finalize,
.class_init = kvm_accel_class_init,
.instance_size = sizeof(KVMState),
};