summaryrefslogtreecommitdiff
path: root/bfd/mmo.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2007-07-26 11:13:59 +0000
committerAlan Modra <amodra@bigpond.net.au>2007-07-26 11:13:59 +0000
commit820e488d729b201b7cc548c8f2277b363dc4e4b0 (patch)
treefd0ffdcb3d0040971cc1c93d16ae59d180ef319b /bfd/mmo.c
parentb2ece17efaa6918b1996a46f4d5b1ccb670ba8c9 (diff)
downloadbinutils-redhat-820e488d729b201b7cc548c8f2277b363dc4e4b0.tar.gz
* srec.c (srec_canonicalize_symtab): Don't alloc when symcount
is zero. Correct return value on error. * mmo.c (mmo_canonicalize_symtab): Likewise. * binary.c (binary_canonicalize_symtab) Correct return on error.
Diffstat (limited to 'bfd/mmo.c')
-rw-r--r--bfd/mmo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/mmo.c b/bfd/mmo.c
index 0d3e9633e7..c0e8082826 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -2097,7 +2097,7 @@ mmo_canonicalize_symtab (bfd *abfd, asymbol **alocation)
unsigned int i;
csymbols = abfd->tdata.mmo_data->csymbols;
- if (csymbols == NULL)
+ if (csymbols == NULL && symcount != 0)
{
asymbol *c;
struct mmo_symbol *s;
@@ -2119,8 +2119,8 @@ mmo_canonicalize_symtab (bfd *abfd, asymbol **alocation)
mmo_sort_mmo_symbols);
csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
- if (csymbols == NULL && symcount != 0)
- return FALSE;
+ if (csymbols == NULL)
+ return -1;
abfd->tdata.mmo_data->csymbols = csymbols;
for (msp = (struct mmo_symbol **) alocation, c = csymbols;