Fixed double free in win32 threads and changed free() to g_free(). (#722)

This commit is contained in:
xorstream 2017-01-20 19:03:35 +11:00 committed by Nguyen Anh Quynh
parent c6de7930c9
commit ee294eebb0
2 changed files with 3 additions and 1 deletions

View file

@ -97,7 +97,9 @@ void *qemu_thread_join(QemuThread *thread)
ret = data->ret;
assert(data->mode != QEMU_THREAD_DETACHED);
DeleteCriticalSection(&data->cs);
data->uc->qemu_thread_data = NULL;
g_free(data);
data = NULL;
return ret;
}

2
uc.c
View file

@ -310,7 +310,7 @@ uc_err uc_close(uc_engine *uc)
// Thread relateds.
if (uc->qemu_thread_data)
free(uc->qemu_thread_data);
g_free(uc->qemu_thread_data);
// Other auxilaries.
free(uc->l1_map);