This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] solib.c, reload_shared_libraries_1, close memory leak
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 03 Mar 2011 17:09:11 -0800
- Subject: [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)
{