summaryrefslogtreecommitdiff
path: root/bfd/coff64-rs6000.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2002-06-07 15:04:49 +0000
committerAlan Modra <amodra@bigpond.net.au>2002-06-07 15:04:49 +0000
commit10de1cbaf381d28993e64086215310eaf63c2ef9 (patch)
treec41bd39cc9e8c13aa0111bcc298b70781a8e164c /bfd/coff64-rs6000.c
parent4fa8d0495f811c9d58fbdac2da08acc29b44d4fe (diff)
downloadgdb-10de1cbaf381d28993e64086215310eaf63c2ef9.tar.gz
Replace bfd_alloc/bfd_malloc + memset with bfd_zalloc/bfd_zmalloc
Diffstat (limited to 'bfd/coff64-rs6000.c')
-rw-r--r--bfd/coff64-rs6000.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 16b63d4f8ab..c7fe5ac5e73 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -2264,12 +2264,10 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
data_buffer_size = 0x0058 + initsz + finisz;
data_buffer_size += (data_buffer_size & 7) ? 8 - (data_buffer_size & 7) : 0;
data_buffer = NULL;
- data_buffer = (bfd_byte *)bfd_malloc (data_buffer_size);
+ data_buffer = (bfd_byte *) bfd_zmalloc (data_buffer_size);
if (data_buffer == NULL)
return false;
- memset (data_buffer, 0, data_buffer_size);
-
if (initsz)
{
val = 0x18;
@@ -2302,8 +2300,10 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
if (true == rtld)
string_table_size += strlen (rtld_name) + 1;
- string_table = (bfd_byte *)bfd_malloc (string_table_size);
- memset (string_table, 0, string_table_size);
+ string_table = (bfd_byte *) bfd_zmalloc (string_table_size);
+ if (string_table == NULL)
+ return false;
+
val = string_table_size;
bfd_put_32 (abfd, val, &string_table[0]);
st_tmp = string_table + 4;