qemu-thread-win32: Prevent null pointer dereference in win32_start_routine

This commit is contained in:
Lioncash 2018-03-21 12:42:44 -04:00
parent 43fe0c8a1c
commit b65302b377
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -47,13 +47,14 @@ static unsigned __stdcall win32_start_routine(void *arg)
QemuThreadData *data = (QemuThreadData *) arg;
void *(*start_routine)(void *) = data->start_routine;
void *thread_arg = data->arg;
struct uc_struct *uc = data->uc;
if (data->mode == QEMU_THREAD_DETACHED) {
data->uc->qemu_thread_data = NULL;
g_free(data);
data = NULL;
}
qemu_thread_exit(data->uc, start_routine(thread_arg));
qemu_thread_exit(uc, start_routine(thread_arg));
abort();
}