svn commit: r310132 - head/contrib/binutils/bfd

Pedro F. Giffuni pfg at FreeBSD.org
Fri Dec 16 00:36:01 UTC 2016


Author: pfg
Date: Fri Dec 16 00:35:59 2016
New Revision: 310132
URL: https://svnweb.freebsd.org/changeset/base/310132

Log:
  libbfd: make sure variables are initialized before using them.
  
  Initialize l_sec_contents to make sure that free(l_sec_contents) is called
  on valid pointers.
  
  Obtained from:	OpenBSD (partial CVS rev 1.18)
  MFC after:	5 days

Modified:
  head/contrib/binutils/bfd/elflink.c

Modified: head/contrib/binutils/bfd/elflink.c
==============================================================================
--- head/contrib/binutils/bfd/elflink.c	Fri Dec 16 00:23:59 2016	(r310131)
+++ head/contrib/binutils/bfd/elflink.c	Fri Dec 16 00:35:59 2016	(r310132)
@@ -11487,7 +11487,7 @@ _bfd_elf_section_already_linked (bfd *ab
 		   abfd, sec);
 	      else if (sec->size != 0)
 		{
-		  bfd_byte *sec_contents, *l_sec_contents;
+		  bfd_byte *sec_contents, *l_sec_contents = NULL;
 
 		  if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
 		    (*_bfd_error_handler)


More information about the svn-src-all mailing list