Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- hw/core/accel.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/hw/core/accel.c b/hw/core/accel.c index 4deb53f..b86773d 100644 --- a/hw/core/accel.c +++ b/hw/core/accel.c @@ -60,11 +60,15 @@ static AccelClass *accel_find(const char *opt_name) static int accel_init_machine(AccelClass *acc, MachineState *ms) { + ObjectClass *oc = OBJECT_CLASS(acc); + const char *cname = object_class_get_name(oc); + AccelState *accel = ACCEL(object_new(cname)); int ret; *(acc->allowed) = true; ret = acc->init_machine(ms); if (ret < 0) { *(acc->allowed) = false; + object_unref(OBJECT(accel)); } return ret; } -- 1.9.3