summaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-11-10 20:25:56 +0000
committerKeith Seitz <keiths@redhat.com>2012-11-10 20:25:56 +0000
commit7c91ec92462f34a23948636ee6bbc0369644c07e (patch)
tree55d104df16e4428a094cfcae8019fff09777c1b7 /gdb/linespec.c
parent6cad06895668ad73b91161fc2c95f0b113bdb898 (diff)
downloadgdb-7c91ec92462f34a23948636ee6bbc0369644c07e.tar.gz
* breakpoint.c (clear_command): Add cleanup for
sals.sals if an argument is given. * linespec.c (parse_linespec): Do cleanups after parsing a convenience variable.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 06634d28394..e9918b1943a 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2095,20 +2095,17 @@ parse_linespec (linespec_parser *parser, char **argptr)
cleanup = make_cleanup (xfree, var);
PARSER_RESULT (parser)->line_offset
= linespec_parse_variable (PARSER_STATE (parser), var);
+ do_cleanups (cleanup);
/* If a line_offset wasn't found (VAR is the name of a user
variable/function), then skip to normal symbol processing. */
if (PARSER_RESULT (parser)->line_offset.sign != LINE_OFFSET_UNKNOWN)
{
- discard_cleanups (cleanup);
-
/* Consume this token. */
linespec_lexer_consume_token (parser);
goto convert_to_sals;
}
-
- do_cleanups (cleanup);
}
else if (token.type != LSTOKEN_STRING && token.type != LSTOKEN_NUMBER)
unexpected_linespec_error (parser);