diff mbox series

[62/88] user: use g_new() family of functions

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

Commit Message

Philippe Mathieu-Daudé Oct. 6, 2017, 11:49 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[PMD: added linux-user/elfload.c]
---
 linux-user/elfload.c | 2 +-
 thunk.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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);