From d25d759de9c291677a64bf9e3150217a0a629e22 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Wed, 11 Jun 2003 10:32:08 +0000 Subject: * write.c (write_relocs): Use xcalloc. Fix relocs initialization in the RELOC_EXPANSION_POSSIBLE case. --- gas/write.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gas/write.c') diff --git a/gas/write.c b/gas/write.c index ce40572..3c6adf5 100644 --- a/gas/write.c +++ b/gas/write.c @@ -938,8 +938,7 @@ write_relocs (abfd, sec, xxx) #ifndef RELOC_EXPANSION_POSSIBLE /* Set up reloc information as well. */ - relocs = (arelent **) xmalloc (n * sizeof (arelent *)); - memset ((char *) relocs, 0, n * sizeof (arelent *)); + relocs = (arelent **) xcalloc (n, sizeof (arelent *)); i = 0; for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next) @@ -1011,7 +1010,7 @@ write_relocs (abfd, sec, xxx) #else n = n * MAX_RELOC_EXPANSION; /* Set up reloc information as well. */ - relocs = (arelent **) xmalloc (n * sizeof (arelent *)); + relocs = (arelent **) xcalloc (n, sizeof (arelent *)); i = 0; for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next) -- cgit v1.1