diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-04-21 04:10:18 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-04-21 04:10:18 +0000 |
commit | 2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8 (patch) | |
tree | b79970c8cd4311360bd46b55935949224f31e326 /gdb/printcmd.c | |
parent | 61c37cee5da9d08b107ec331b1080f1982f5afa1 (diff) | |
download | gdb-2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8.zip gdb-2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8.tar.gz gdb-2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8.tar.bz2 |
* defs.h, utils.c (free_current_contents): Change parameter to
void*.
From Philippe De Muyter <phdm@macqel.be>:
* printcmd.c (print_address_symbolic): Call `make_cleanup' with
`(free_current_contents, &x)', not `(free, x)'.
* utils.c (free_current_contents): Do not `free (NULL)'.
* printcmd.c (print_address_symbolic): Cleanup after a failed
call to build_address_symbolic.
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) |