target-openrisc: Free typename in openrisc_cpu_class_by_name

We should free typename here.

Signed-off-by: Jia Liu <proljc@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Jia Liu 2013-07-23 18:32:30 +08:00
parent 4284c0517b
commit 9b146e9a28

View File

@ -99,6 +99,7 @@ static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model)
typename = g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model);
oc = object_class_by_name(typename);
g_free(typename);
if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) ||
object_class_is_abstract(oc))) {
return NULL;