This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Patch to fix memory leak in bfd
- To: binutils@sourceware.cygnus.com
- Subject: Patch to fix memory leak in bfd
- From: Nick Clifton <nickc@cygnus.com>
- Date: Thu, 2 Sep 1999 18:59:42 +0100
Hi Guys,
I have just applied the following patch to fix a memory leak in
bfd.
Cheers
Nick
1999-09-02 Nick Clifton <nickc@cygnus.com>
* elflink.h (elf_gc_record_vtentry): Fix memory leak.
Index: elflink.h
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elflink.h,v
retrieving revision 1.134
diff -p -r1.134 elflink.h
*** elflink.h 1999/08/31 07:09:04 1.134
- --- elflink.h 1999/09/02 17:40:52
*************** elf_gc_record_vtentry (abfd, sec, h, add
*** 6302,6310 ****
ptr = realloc (ptr-1, bytes);
if (ptr == NULL)
return false;
!
oldbytes = (h->vtable_entries_size/FILE_ALIGN + 1) * sizeof(boolean);
! memset (ptr + oldbytes, 0, bytes - oldbytes);
}
else
{
- --- 6302,6310 ----
ptr = realloc (ptr-1, bytes);
if (ptr == NULL)
return false;
!
oldbytes = (h->vtable_entries_size/FILE_ALIGN + 1) * sizeof(boolean);
! memset (((char *)ptr) + oldbytes, 0, bytes - oldbytes);
}
else
{