aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/hostio.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2008-12-14 20:51:04 +0000
committerDoug Evans <dje@google.com>2008-12-14 20:51:04 +0000
commitbca929d3a66489b6b2aff2a9a81bc17853dff79e (patch)
tree01fb0fc214848cab8a2629b58956f92238f7edf5 /gdb/gdbserver/hostio.c
parent023eb17ca2bc152be687b0b5676bdb6fda6cd9d1 (diff)
downloadgdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.zip
gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.tar.gz
gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.tar.bz2
* utils.c (xmalloc,xcalloc,xstrdup): New fns.
* server.h (ATTR_MALLOC): New macro. (xmalloc,xcalloc,xstrdup): Declare. * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup. * inferiors.c: Ditto. * linux-low.c: Ditto. * mem-break.c: Ditto. * regcache.c: Ditto. * remote-utils.c: Ditto. * server.c: Ditto. * target.c: Ditto. * win32-low.c: Ditto.
Diffstat (limited to 'gdb/gdbserver/hostio.c')
-rw-r--r--gdb/gdbserver/hostio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c
index 712deb4..b3e26cd 100644
--- a/gdb/gdbserver/hostio.c
+++ b/gdb/gdbserver/hostio.c
@@ -116,7 +116,7 @@ require_data (char *p, int p_len, char **data, int *data_len)
{
int input_index, output_index, escaped;
- *data = malloc (p_len);
+ *data = xmalloc (p_len);
output_index = 0;
escaped = 0;
@@ -295,7 +295,7 @@ handle_open (char *own_buf)
}
/* Record the new file descriptor. */
- new_fd = malloc (sizeof (struct fd_list));
+ new_fd = xmalloc (sizeof (struct fd_list));
new_fd->fd = fd;
new_fd->next = open_fds;
open_fds = new_fd;
@@ -323,7 +323,7 @@ handle_pread (char *own_buf, int *new_packet_len)
return;
}
- data = malloc (len);
+ data = xmalloc (len);
#ifdef HAVE_PREAD
ret = pread (fd, data, len, offset);
#else