From: Marc-André Lureau <marcandre.lur...@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> [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