aboutsummaryrefslogtreecommitdiff
path: root/bfd
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
commit44c62d9e249963c9e9c0e2b658c8bf50d90237fc (patch)
tree39b7ed784549c3ead3ae9f34a4e7bb72c05449ff /bfd
parent078c4bfc87bccd0c6e352192956ae8deaa5eaa86 (diff)
downloadfsf-binutils-gdb-44c62d9e249963c9e9c0e2b658c8bf50d90237fc.zip
fsf-binutils-gdb-44c62d9e249963c9e9c0e2b658c8bf50d90237fc.tar.gz
fsf-binutils-gdb-44c62d9e249963c9e9c0e2b658c8bf50d90237fc.tar.bz2
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')
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/coffgen.c21
2 files changed, 16 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4fd7f4a..54ef404 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,8 @@
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.
+
* aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero
or count == zero.
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index f4f97b3..7fad78c 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;