mips: Fix memleak

This commit is contained in:
danghvu
2016-07-09 20:16:00 -05:00
parent 117a318188
commit 27e0699ef5
7 changed files with 37 additions and 3 deletions

View File

@ -35,8 +35,8 @@ static int mips_r4k_init(struct uc_struct *uc, MachineState *machine)
#endif
}
cpu = cpu_mips_init(uc, cpu_model);
if (cpu == NULL) {
uc->cpu = (void*) cpu_mips_init(uc, cpu_model);
if (uc->cpu == NULL) {
fprintf(stderr, "Unable to find CPU definition\n");
return -1;
}