bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/868] bfd leaks memory in several places


From: nickc at redhat dot com
Subject: [Bug binutils/868] bfd leaks memory in several places
Date: 20 Feb 2008 17:44:31 -0000

------- Additional Comments From nickc at redhat dot com  2008-02-20 17:44 
-------
Hi John,

  I have checked in the patch to implement and use bfd_realloc_or_free.

  I am going to close this issue for, since the specific problem of using
bfd_realloc has now been addressed, but it can be reopened if more memory leaks
are discovered.

Cheers
  Nick

bfd/ChangeLog
2008-02-20  Nick Clifton  <address@hidden>

        PR 868
        * libbfd.c (bfd_realloc_or_free): New function.  Performs like
        bfd_realloc, but if the (re)allocation fails, the pointer is
        freed.
        * libbfd-in.h: Prototype.
        * libbfd.h: Regenerate.
        * bfdio.c (bfd_bwrite): Use the new function.
        (bfd_seek): Likewise.
        * bfdwin.c:(bfd_get_file_window): Likewise.
        * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
        * elf32-ppc.c (ppc_elf_relax_section): Likewise.
        * elf32-xtensa.c (vsprintf_msg): Likewise.
        * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
        * stabs.c (_bfd_link_seciton_stabs): Likewise.
        * vms-misc.c (_bfd_vms_get_record): Likewise.
        * vms-tir.c (check_section): Likewise.
        * vms.c (vms_new_section_hook): Likewise.
        * elf32-arm.c (elf32_arm_section_map_add): Check that the
        allocation of sec_data->map succeeded before using it.
        * elflink.c (elf_link_output_sym): Do not overwrite finfo->
        symshndxbuf until it is known that the reallocation succeeded.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=868

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]