summaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-07-26 18:43:24 +0000
committerMichael Snyder <msnyder@vmware.com>2007-07-26 18:43:24 +0000
commitdf0bda3ce8be60327e86bfef543200a696e32e5f (patch)
treec76c3a11e110d4b33867f45232612ea6f47860fe /bfd/coffgen.c
parent257864504bc8a2555cc7cc3a2bc637c25e3ccedd (diff)
downloadbinutils-redhat-df0bda3ce8be60327e86bfef543200a696e32e5f.tar.gz
2007-07-26 Michael Snyder <msnyder@access-company.com>
* coffgen.c (_bfd_coff_read_internal_relocs): If internal_relocs are not to be cached, free the temporary buffer.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index f4f97b3f0d..7fad78c78f 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -457,17 +457,22 @@ _bfd_coff_read_internal_relocs (bfd *abfd,
free_external = NULL;
}
- if (cache && free_internal != NULL)
+ if (free_internal != NULL)
{
- if (coff_section_data (abfd, sec) == NULL)
+ if (cache)
+ free (free_internal);
+ else
{
- amt = sizeof (struct coff_section_tdata);
- sec->used_by_bfd = bfd_zalloc (abfd, amt);
- if (sec->used_by_bfd == NULL)
- goto error_return;
- coff_section_data (abfd, sec)->contents = NULL;
+ if (coff_section_data (abfd, sec) == NULL)
+ {
+ amt = sizeof (struct coff_section_tdata);
+ sec->used_by_bfd = bfd_zalloc (abfd, amt);
+ if (sec->used_by_bfd == NULL)
+ goto error_return;
+ coff_section_data (abfd, sec)->contents = NULL;
+ }
+ coff_section_data (abfd, sec)->relocs = free_internal;
}
- coff_section_data (abfd, sec)->relocs = free_internal;
}
return internal_relocs;