Patch to fix memory leak in bfd

Nick Clifton nickc@cygnus.com
Thu Sep 2 10:59:00 GMT 1999


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
  	{



More information about the Binutils mailing list