diff mbox series

[66/88] util/qemu-thread-win32: use g_new() family of functions

Message ID 20171006235023.11952-67-f4bug@amsat.org
State New
Headers show
Series use g_new() family of functions | expand

Commit Message

Philippe Mathieu-Daudé Oct. 6, 2017, 11:50 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 util/qemu-thread-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Weil Oct. 7, 2017, 6:47 a.m. UTC | #1
Am 07.10.2017 um 01:50 schrieb Philippe Mathieu-Daudé:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  util/qemu-thread-win32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
> index 94f3491a87..098fddb2af 100644
> --- a/util/qemu-thread-win32.c
> +++ b/util/qemu-thread-win32.c
> @@ -394,7 +394,7 @@ void qemu_thread_create(QemuThread *thread, const char *name,
>      HANDLE hThread;
>      struct QemuThreadData *data;
>  
> -    data = g_malloc(sizeof *data);
> +    data = g_new(struct QemuThreadData, 1);
>      data->start_routine = start_routine;
>      data->arg = arg;
>      data->mode = mode;
> 

Reviewed-by: Stefan Weil <sw@weilnetz.de>

Maybe you can use this simplified variant:

    QemuThreadData *data = g_new(QemuThreadData, 1);

Stefan
diff mbox series

Patch

diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index 94f3491a87..098fddb2af 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -394,7 +394,7 @@  void qemu_thread_create(QemuThread *thread, const char *name,
     HANDLE hThread;
     struct QemuThreadData *data;
 
-    data = g_malloc(sizeof *data);
+    data = g_new(struct QemuThreadData, 1);
     data->start_routine = start_routine;
     data->arg = arg;
     data->mode = mode;