diff options
Diffstat (limited to 'gdb/gdbserver/event-loop.c')
-rw-r--r-- | gdb/gdbserver/event-loop.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c index d27bc94..dd07093 100644 --- a/gdb/gdbserver/event-loop.c +++ b/gdb/gdbserver/event-loop.c @@ -197,9 +197,8 @@ process_event (void) int append_callback_event (callback_handler_func *proc, gdb_client_data data) { - struct callback_event *event_ptr; + struct callback_event *event_ptr = XNEW (struct callback_event); - event_ptr = xmalloc (sizeof (*event_ptr)); event_ptr->id = callback_list.num_callbacks++; event_ptr->proc = proc; event_ptr->data = data; @@ -289,7 +288,7 @@ create_file_handler (gdb_fildes_t fd, int mask, handler_func *proc, just change the data associated with it. */ if (file_ptr == NULL) { - file_ptr = xmalloc (sizeof (*file_ptr)); + file_ptr = XNEW (struct file_handler); file_ptr->fd = fd; file_ptr->ready_mask = 0; file_ptr->next_file = gdb_notifier.first_file_handler; @@ -447,9 +446,10 @@ create_file_event (gdb_fildes_t fd) { gdb_event *file_event_ptr; - file_event_ptr = xmalloc (sizeof (gdb_event)); + file_event_ptr = XNEW (gdb_event); file_event_ptr->proc = handle_file_event; file_event_ptr->fd = fd; + return file_event_ptr; } |