diff --git a/hw/core/machine.c b/hw/core/machine.c index e5a456f21dd96b09e8d9482855f95d6a94ad7d6a..00fbe3e880f946d34708a721a2104efbfa89f9d0 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -561,6 +561,7 @@ static void machine_class_finalize(ObjectClass *klass, void *data) if (mc->compat_props) { g_array_free(mc->compat_props, true); } + g_free(mc->name); } void machine_register_compat_props(MachineState *machine) diff --git a/include/hw/boards.h b/include/hw/boards.h index 3e69eca0383823408a7879f28f35dd0d74ee296c..e46a744bcd2578c535e5ce62301954d277e89756 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -93,7 +93,7 @@ struct MachineClass { /*< public >*/ const char *family; /* NULL iff @name identifies a standalone machtype */ - const char *name; + char *name; const char *alias; const char *desc; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 330c1f2d6b3e9aec5cefadfe75d59b4cf0975d63..422fac702a25dbb5c39445f43f80e3461ce9698e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -903,7 +903,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); { \ MachineClass *mc = MACHINE_CLASS(oc); \ optsfn(mc); \ - mc->name = namestr; \ mc->init = initfn; \ } \ static const TypeInfo pc_machine_type_##suffix = { \