aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-08-29 09:27:19 +0000
committerMark Kettenis <kettenis@gnu.org>2005-08-29 09:27:19 +0000
commitf44569944ac2b0aeeffb3758179b77537c2de8b4 (patch)
treebd44c2844f504bf4b8f1a050adbfc66658e90f3e /gdb/solib-svr4.c
parentb8399bbe63df84177daa1bae54fdf91b5c0b45d7 (diff)
downloadgdb-f44569944ac2b0aeeffb3758179b77537c2de8b4.zip
gdb-f44569944ac2b0aeeffb3758179b77537c2de8b4.tar.gz
gdb-f44569944ac2b0aeeffb3758179b77537c2de8b4.tar.bz2
* solib-svr4.c (svr4_current_sos, svr4_fetch_objfile_link_map):
Use XZALLOC and xzalloc instead of xmalloc where appropriate.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index f96142a..eb23f86 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -604,18 +604,14 @@ svr4_current_sos (void)
while (lm)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
- struct so_list *new
- = (struct so_list *) xmalloc (sizeof (struct so_list));
+ struct so_list *new = XZALLOC (struct so_list);
struct cleanup *old_chain = make_cleanup (xfree, new);
- memset (new, 0, sizeof (*new));
-
new->lm_info = xmalloc (sizeof (struct lm_info));
make_cleanup (xfree, new->lm_info);
- new->lm_info->lm = xmalloc (lmo->link_map_size);
+ new->lm_info->lm = xzalloc (lmo->link_map_size);
make_cleanup (xfree, new->lm_info->lm);
- memset (new->lm_info->lm, 0, lmo->link_map_size);
read_memory (lm, new->lm_info->lm, lmo->link_map_size);
@@ -697,9 +693,8 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
/* Set up the buffer to contain the portion of the link_map
structure that gdb cares about. Note that this is not the
whole link_map structure. */
- objfile_lm_info.lm = xmalloc (lmo->link_map_size);
+ objfile_lm_info.lm = xzalloc (lmo->link_map_size);
make_cleanup (xfree, objfile_lm_info.lm);
- memset (objfile_lm_info.lm, 0, lmo->link_map_size);
/* Read the link map into our internal structure. */
read_memory (lm, objfile_lm_info.lm, lmo->link_map_size);