memleak: Fix Sparc memory leak

This commit is contained in:
danghvu
2016-10-03 14:23:27 -05:00
parent 6aea0aee58
commit 84d99412bc
2 changed files with 34 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ static int leon3_generic_hw_init(struct uc_struct *uc, MachineState *machine)
cpu_model = "LEON3";
}
cpu = cpu_sparc_init(uc, cpu_model);
uc->cpu = cpu = cpu_sparc_init(uc, cpu_model);
if (cpu == NULL) {
fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
return -1;