diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 352c390d0c6fce203c86b0d9cce362b22f15c5b2..99cff65aae4d47cd7ad7d637f1c35f5ae5adddfe 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -950,6 +950,7 @@ static int cpudef_setfield(const char *name, const char *str, void *opaque) int err = 0; if (!strcmp(name, "name")) { + g_free((void *)def->name); def->name = g_strdup(str); } else if (!strcmp(name, "model_id")) { strncpy(def->model_id, str, sizeof (def->model_id));