From: Tom Tromey Date: Mon, 22 Jul 2013 18:00:50 +0000 (+0000) Subject: fix solib-som.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29b2cc46a5b148d39bd003a530c93aead7859bbc;p=binutils-gdb.git fix solib-som.c som_open_symbol_file_object was leaking a cleanup. * solib-som.c (som_open_symbol_file_object): Call do_cleanups. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 66039099c62..b0d3e5506b3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2013-07-22 Tom Tromey + + * solib-som.c (som_open_symbol_file_object): Call do_cleanups. + 2013-07-22 Tom Tromey * dwarf2read.c (init_cutu_and_read_dies): Remove 'free_cu_cleanup'. diff --git a/gdb/solib-som.c b/gdb/solib-som.c index f88b5391259..457e464d72c 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; }