This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] solib.c, reload_shared_libraries_1, close memory leak


OK?

2011-03-03  Michael Snyder  <msnyder@vmware.com>

	* solib.c (reload_shared_libraries_1): Close memory leak.

Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.145
diff -u -p -u -p -r1.145 solib.c
--- solib.c	26 Jan 2011 01:55:19 -0000	1.145
+++ solib.c	4 Mar 2011 01:06:54 -0000
@@ -1326,6 +1326,7 @@ reload_shared_libraries_1 (int from_tty)
 	SYMFILE_DEFER_BP_RESET | (from_tty ? SYMFILE_VERBOSE : 0);
 
       filename = tilde_expand (so->so_original_name);
+      make_cleanup (xfree, filename);
       abfd = solib_bfd_open (filename);
       if (abfd != NULL)
 	{

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