[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 62/88] user: use g_new() family of functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 62/88] user: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:49:57 -0300 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: added linux-user/elfload.c]
---
linux-user/elfload.c | 2 +-
thunk.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 79062882ba..0a826071e9 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -3014,7 +3014,7 @@ static void fill_thread_info(struct elf_note_info *info,
const CPUArchState *env
TaskState *ts = (TaskState *)cpu->opaque;
struct elf_thread_status *ets;
- ets = g_malloc0(sizeof (*ets));
+ ets = g_new0(struct elf_thread_status, 1);
ets->num_notes = 1; /* only prstatus is dumped */
fill_prstatus(&ets->prstatus, ts, 0);
elf_core_copy_regs(&ets->prstatus.pr_reg, env);
diff --git a/thunk.c b/thunk.c
index d5d8645cd4..17f3d320bb 100644
--- a/thunk.c
+++ b/thunk.c
@@ -89,7 +89,7 @@ void thunk_register_struct(int id, const char *name, const
argtype *types)
for(i = 0;i < 2; i++) {
offset = 0;
max_align = 1;
- se->field_offsets[i] = malloc(nb_fields * sizeof(int));
+ se->field_offsets[i] = g_new(int, nb_fields);
type_ptr = se->field_types;
for(j = 0;j < nb_fields; j++) {
size = thunk_type_size(type_ptr, i);
--
2.14.2
- [Qemu-devel] [PATCH 57/88] ppc: use g_new() family of functions, (continued)
- [Qemu-devel] [PATCH 57/88] ppc: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 58/88] ppc4xx: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 59/88] ppce500: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 60/88] sPAPR: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 61/88] tests: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 62/88] user: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 63/88] bsd-user/syscall: fix a memory leak on EFAULT, use g_new(), Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 64/88] user: use g_strfreev(), Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 65/88] util: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 66/88] util/qemu-thread-win32: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 67/88] util/coroutine: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 68/88] virtio: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 69/88] virtio-9p: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06