diff options
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index ff4ff36..a74ffa2 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -562,12 +562,15 @@ print_address_symbolic (addr, stream, do_demangle, leadin) int offset = 0; int line = 0; - struct cleanup *cleanup_chain = make_cleanup (free, name); - if (print_symbol_filename) - make_cleanup (free, filename); + /* throw away both name and filename */ + struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &name); + make_cleanup (free_current_contents, &filename); if (build_address_symbolic (addr, do_demangle, &name, &offset, &filename, &line, &unmapped)) - return; + { + do_cleanups (cleanup_chain); + return; + } fputs_filtered (leadin, stream); if (unmapped) |