aboutsummaryrefslogtreecommitdiff
path: root/bfd/ecofflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-06-07 15:04:49 +0000
committerAlan Modra <amodra@gmail.com>2002-06-07 15:04:49 +0000
commit9bab7074b06e5c0661db3ec95c584ff221fc61ec (patch)
treee018b581bbf2801ccb49cdcef5de6066b63c2a21 /bfd/ecofflink.c
parent9758f3fc77f7b9748293b7e265d362ceaddfdfb4 (diff)
downloadgdb-9bab7074b06e5c0661db3ec95c584ff221fc61ec.zip
gdb-9bab7074b06e5c0661db3ec95c584ff221fc61ec.tar.gz
gdb-9bab7074b06e5c0661db3ec95c584ff221fc61ec.tar.bz2
Replace bfd_alloc/bfd_malloc + memset with bfd_zalloc/bfd_zmalloc
Diffstat (limited to 'bfd/ecofflink.c')
-rw-r--r--bfd/ecofflink.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c
index 53d6544..8044f3a 100644
--- a/bfd/ecofflink.c
+++ b/bfd/ecofflink.c
@@ -1,5 +1,5 @@
/* Routines to link ECOFF debugging information.
- Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001
+ Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
@@ -1650,11 +1650,10 @@ ecoff_write_shuffle (abfd, swap, shuffle, space)
bfd_byte *s;
i = swap->debug_align - (total & (swap->debug_align - 1));
- s = (bfd_byte *) bfd_malloc ((bfd_size_type) i);
+ s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i);
if (s == NULL && i != 0)
return false;
- memset ((PTR) s, 0, i);
if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
{
free (s);
@@ -1736,10 +1735,10 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
bfd_byte *s;
i = swap->debug_align - (total & (swap->debug_align - 1));
- s = (bfd_byte *) bfd_malloc ((bfd_size_type) i);
+ s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i);
if (s == NULL && i != 0)
goto error_return;
- memset ((PTR) s, 0, i);
+
if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
{
free (s);
@@ -1761,10 +1760,10 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
i = (swap->debug_align
- (debug->symbolic_header.issExtMax & (swap->debug_align - 1)));
- s = (bfd_byte *) bfd_malloc ((bfd_size_type) i);
+ s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i);
if (s == NULL && i != 0)
goto error_return;
- memset ((PTR) s, 0, i);
+
if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
{
free (s);