2007-07-30 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 31 Jul 2007 03:53:24 +0000 (03:53 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 31 Jul 2007 03:53:24 +0000 (03:53 +0000)
* coffgen.c (_bfd_coff_read_internal_relocs): Revert change of
2007-07-26.  Buffer still in use, can't be freed.

bfd/ChangeLog
bfd/coffgen.c

index 4f519a3ea76a4f86bf027beba753eae2a987122f..867bc3159e0e5c6fa90d5c04f4febc7da30e9eec 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-30  Michael Snyder  <msnyder@access-company.com>
+
+       * coffgen.c (_bfd_coff_read_internal_relocs): Revert change of
+       2007-07-26.  Buffer still in use, can't be freed.
+
 2007-07-27  Michael Snyder  <msnyder@access-company.com>
 
        * cofflink.c (coff_link_add_symbols): Return if count is zero.
index e5fb6454d34fb185cba4eb360f3e4562fb969aed..0ecc6023e6d5766c2a6c1a65ec9f2e023313fa23 100644 (file)
@@ -460,22 +460,17 @@ _bfd_coff_read_internal_relocs (bfd *abfd,
       free_external = NULL;
     }
 
-  if (free_internal != NULL)
+  if (cache && free_internal != NULL)
     {
-      if (cache)
-       free (free_internal);
-      else
+      if (coff_section_data (abfd, sec) == 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;
+         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;
     }
 
   return internal_relocs;