Fix memleak: do not re-initialize halt_cond

This commit is contained in:
danghvu 2016-07-06 01:49:10 -05:00
parent de5786f98d
commit ada1c13662

View file

@ -140,8 +140,10 @@ static int qemu_tcg_init_vcpu(CPUState *cpu)
tcg_cpu_address_space_init(cpu, cpu->as); tcg_cpu_address_space_init(cpu, cpu->as);
/* share a single thread for all cpus with TCG */ /* share a single thread for all cpus with TCG */
cpu->halt_cond = g_malloc0(sizeof(QemuCond)); if (!cpu->halt_cond) {
qemu_cond_init(cpu->halt_cond); cpu->halt_cond = g_malloc0(sizeof(QemuCond));
qemu_cond_init(cpu->halt_cond);
}
uc->tcg_halt_cond = cpu->halt_cond; uc->tcg_halt_cond = cpu->halt_cond;
return 0; return 0;