bug-binutils
[Top][All Lists]
Advanced

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

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


From: levon at movementarian dot org
Subject: [Bug binutils/868] New: bfd leaks memory in several places
Date: 23 Apr 2005 19:35:57 -0000

bfd has several memory leaks. I'm fixing the ones in dwarf2.c, but a simple grep
for 'bfd_realloc' shows several obvious leaks on failure:

./bfd/bfdio.c:        bim->buffer = bfd_realloc (bim->buffer, newsize);
./bfd/bfdio.c:            bim->buffer = bfd_realloc (bim->buffer, newsize);
./bfd/bfdwin.c:  i->data = bfd_realloc (i->data, size_to_alloc);
./bfd/elf-eh-frame.c:     sec_info = bfd_realloc (sec_info,
./bfd/elf-strtab.c:       tab->array = bfd_realloc (tab->array, tab->alloced * 
amt);
./bfd/elf32-arm.c:  map = bfd_realloc (map, mapcount * sizeof
(elf32_arm_section_map));
./bfd/elf32-ppc.c:      contents = bfd_realloc (contents, trampoff);
./bfd/elf32-xtensa.c:      message = (char *) bfd_realloc (message, len);
./bfd/elflink.c:          finfo->symshndxbuf = destshndx = bfd_realloc
(destshndx, amt * 2);
./bfd/elfxx-ia64.c:           contents = (bfd_byte *) bfd_realloc (contents, 
amt);
./bfd/ihex.c:         buf = bfd_realloc (buf, (bfd_size_type) chars);
./bfd/ihex.c:     buf = bfd_realloc (buf, (bfd_size_type) len * 2);
./bfd/mach-o.c:       buf = bfd_realloc (buf, size);
./bfd/stabs.c:                    symb = bfd_realloc (symb, buf_len);
./bfd/vms-misc.c:         PRIV (vms_buf) = bfd_realloc (vms_buf,
./bfd/vms-tir.c:        = bfd_realloc (PRIV (image_section)->contents, offset +
size);
./bfd/vms-tir.c:  PRIV (sections) = bfd_realloc (PRIV (sections), amt);
./bfd/vms.c:      PRIV (sections) = bfd_realloc (PRIV (sections), amt);

Hopefully at some point somebody can find time to carefully audit the whole
source base, these are just a few obvious leak points.

-- 
           Summary: bfd leaks memory in several places
           Product: binutils
           Version: 2.17 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: levon at movementarian dot org
                CC: bug-binutils at gnu dot org


http://sources.redhat.com/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]