This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: objdump leaks?


On Tue, 23 May 2000, Alex Rosenberg wrote:

> display_target_list() and display_info_table() both appear to leak bfd
> structures because their calls to bfd_openw() are not matched by bfd_close()
> calls.

Does this fix your problem?

bfd/ChangeLog
	* objdump.c (display_target_list): Close the bfd.
	(display_info_table): Likewise.

Index: objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.25
diff -u -p -r1.25 objdump.c
--- objdump.c	2000/05/13 06:38:34	1.25
+++ objdump.c	2000/05/24 02:06:39
@@ -2653,6 +2653,7 @@ display_target_list ()
 	{
 	  if (bfd_get_error () != bfd_error_invalid_operation)
 	    nonfatal (p->name);
+	  bfd_close (abfd);
 	  continue;
 	}
 
@@ -2660,6 +2661,7 @@ display_target_list ()
 	if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0))
 	  printf ("  %s\n",
 		  bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
+      bfd_close (abfd);
     }
   unlink (dummy_name);
   free (dummy_name);
@@ -2727,6 +2729,7 @@ display_info_table (first, last)
 		  putchar ('-');
 		putchar (' ');
 	      }
+	    bfd_close (abfd);
 	  }
 	putchar ('\n');
       }

-- 
Linuxcare.  Support for the Revolution.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]