2007-07-25 Michael Snyder * coffgen.c (_bfd_coff_read_internal_relocs): If internal_relocs are not to be cached, free the temporary buffer. Index: coffgen.c =================================================================== RCS file: /cvs/src/src/bfd/coffgen.c,v retrieving revision 1.59 diff -p -r1.59 coffgen.c *** coffgen.c 12 Jul 2007 07:16:40 -0000 1.59 --- coffgen.c 25 Jul 2007 23:41:50 -0000 *************** _bfd_coff_read_internal_relocs (bfd *abf *** 457,473 **** free_external = NULL; } ! if (cache && free_internal != 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; } return internal_relocs; --- 457,478 ---- free_external = NULL; } ! if (free_internal != NULL) { ! if (cache == FALSE) ! free (free_internal); ! else { ! 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; } } return internal_relocs;