diff options
author | Alan Modra <amodra@gmail.com> | 2007-07-26 11:13:59 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2007-07-26 11:13:59 +0000 |
commit | b9da616afe44eb7d00a669dad47bc6860e9b23d3 (patch) | |
tree | c277c948f1400b1d03e3eb1f4e3280d938a1bed4 /bfd/srec.c | |
parent | c2c966314bffced41c51b7bd0562c1d7a5c679ea (diff) | |
download | binutils-gdb-b9da616afe44eb7d00a669dad47bc6860e9b23d3.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/srec.c')
-rw-r--r-- | bfd/srec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/srec.c b/bfd/srec.c index cd61cd2dc35..a5f588c231e 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1125,14 +1125,14 @@ srec_canonicalize_symtab (bfd *abfd, asymbol **alocation) unsigned int i; csymbols = abfd->tdata.srec_data->csymbols; - if (csymbols == NULL) + if (csymbols == NULL && symcount != 0) { asymbol *c; struct srec_symbol *s; csymbols = bfd_alloc (abfd, symcount * sizeof (asymbol)); - if (csymbols == NULL && symcount != 0) - return 0; + if (csymbols == NULL) + return -1; abfd->tdata.srec_data->csymbols = csymbols; for (s = abfd->tdata.srec_data->symbols, c = csymbols; |