]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/pdp11.c
Replace bfd_alloc/bfd_malloc + memset with bfd_zalloc/bfd_zmalloc
[thirdparty/binutils-gdb.git] / bfd / pdp11.c
index d4fe79eba651dec89c7043cbaf51330a7f1e7260..90db56b987574cf4592367e441d4574a573329a1 100644 (file)
@@ -1841,11 +1841,9 @@ NAME(aout,slurp_symbol_table) (abfd)
 
   cached_size = obj_aout_external_sym_count (abfd);
   cached_size *= sizeof (aout_symbol_type);
-  cached = (aout_symbol_type *) bfd_malloc (cached_size);
+  cached = (aout_symbol_type *) bfd_zmalloc (cached_size);
   if (cached == NULL && cached_size != 0)
     return false;
-  if (cached_size != 0)
-    memset (cached, 0, (size_t) cached_size);
 
   /* Convert from external symbol information to internal.  */
   if (! (NAME(aout,translate_symbol_table)
@@ -2255,10 +2253,9 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols)
     count = real_count;
   }
 
-  reloc_cache = (arelent *) bfd_malloc (count * sizeof (arelent));
+  reloc_cache = (arelent *) bfd_zmalloc (count * sizeof (arelent));
   if (reloc_cache == NULL && count != 0)
     return false;
-  memset (reloc_cache, 0, (size_t) count * sizeof (arelent));
 
   cache_ptr = reloc_cache;
 
@@ -2319,8 +2316,6 @@ NAME(aout,squirt_out_relocs) (abfd, section)
   if (!native)
     return false;
 
-  memset ((PTR)native, 0, (size_t) natsize);
-
   generic = section->orelocation;
   if (generic != NULL)
     {