From: Tom Tromey Date: Thu, 30 May 2013 16:57:38 +0000 (+0000) Subject: fix linespec bug noticed by the checker X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e61727abf0dca6c26548e1df9d51a370faf28542;p=binutils-gdb.git fix linespec bug noticed by the checker This fixes a linespec bug noticed by the cleanup checker. find_linespec_symbols did this: cleanup = demangle_for_lookup (name, state->language->la_language, &lookup_name); [...] cleanup = make_cleanup (xfree, canon); But this is wrong, as it makes a subsequent call to do_cleanups not clean up all the local state. * linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eaa47a08910..4f323851a17 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2013-05-30 Tom Tromey + + * linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'. + 2013-05-30 Tom Tromey * cli/cli-script.c (setup_user_args): Don't return after error. diff --git a/gdb/linespec.c b/gdb/linespec.c index 989c8d270fa..61e5377bc24 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3097,7 +3097,7 @@ find_linespec_symbols (struct linespec_state *state, if (canon != NULL) { lookup_name = canon; - cleanup = make_cleanup (xfree, canon); + make_cleanup (xfree, canon); } /* It's important to not call expand_symtabs_matching unnecessarily