aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 16:57:38 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 16:57:38 +0000
commite61727abf0dca6c26548e1df9d51a370faf28542 (patch)
tree42c3da034fe85731e9eb27674de591e760ad272a /gdb/linespec.c
parentb81b921f794dc3ce6112e784f39511004c7cb542 (diff)
downloadgdb-e61727abf0dca6c26548e1df9d51a370faf28542.zip
gdb-e61727abf0dca6c26548e1df9d51a370faf28542.tar.gz
gdb-e61727abf0dca6c26548e1df9d51a370faf28542.tar.bz2
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'.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 989c8d2..61e5377 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