This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] fix solib-som.c
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Tue, 18 Jun 2013 13:44:29 -0600
- Subject: [PATCH 3/3] fix solib-som.c
- References: <1371584669-1687-1-git-send-email-tromey at redhat dot com>
som_open_symbol_file_object was leaking a cleanup.
* solib-som.c (som_open_symbol_file_object): Call do_cleanups.
---
gdb/solib-som.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gdb/solib-som.c b/gdb/solib-som.c
index f88b539..457e464 100644
--- a/gdb/solib-som.c
+++ b/gdb/solib-som.c
@@ -698,6 +698,7 @@ som_open_symbol_file_object (void *from_ttyp)
int errcode;
int from_tty = *(int *)from_ttyp;
gdb_byte buf[4];
+ struct cleanup *cleanup;
if (symfile_objfile)
if (!query (_("Attempt to reload symbols from process? ")))
@@ -727,10 +728,11 @@ som_open_symbol_file_object (void *from_ttyp)
return 0;
}
- make_cleanup (xfree, filename);
+ cleanup = make_cleanup (xfree, filename);
/* Have a pathname: read the symbol file. */
symbol_file_add_main (filename, from_tty);
+ do_cleanups (cleanup);
return 1;
}
--
1.8.1.4