From ee294eebb0d35d9583098947180db838c4c55334 Mon Sep 17 00:00:00 2001 From: xorstream Date: Fri, 20 Jan 2017 19:03:35 +1100 Subject: [PATCH] Fixed double free in win32 threads and changed free() to g_free(). (#722) --- qemu/util/qemu-thread-win32.c | 2 ++ uc.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu/util/qemu-thread-win32.c b/qemu/util/qemu-thread-win32.c index 2035ddac..3a85e6a4 100644 --- a/qemu/util/qemu-thread-win32.c +++ b/qemu/util/qemu-thread-win32.c @@ -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; } diff --git a/uc.c b/uc.c index 19aedaee..348e47c1 100644 --- a/uc.c +++ b/uc.c @@ -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);