aboutsummaryrefslogtreecommitdiffstats
path: root/parse-events.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-02-04 16:06:19 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-02-04 16:06:19 -0500
commitfc061d0f3d0d22fa1764ecba7bf91178cc1bc36b (patch)
tree95ee55125f1a6613572c623b47e7ff9aef4007e7 /parse-events.c
parent535b5b2da1f2611d5fae96c738a14539c974544f (diff)
trace-cmd: Do not free op tokens
The arg parsing for -1 would free the '-' op and the 1 would get stored there. Later the '1' would be processed as an op, and this caused the parser to fail. Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'parse-events.c')
-rw-r--r--parse-events.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse-events.c b/parse-events.c
index 53087d9..672fd84 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -1445,6 +1445,7 @@ static void set_op_prio(struct print_arg *arg)
1445 arg->op.prio = get_op_prio(arg->op.op); 1445 arg->op.prio = get_op_prio(arg->op.op);
1446} 1446}
1447 1447
1448/* Note, *tok does not get freed, but will most likely be saved */
1448static enum event_type 1449static enum event_type
1449process_op(struct event_format *event, struct print_arg *arg, char **tok) 1450process_op(struct event_format *event, struct print_arg *arg, char **tok)
1450{ 1451{
@@ -1480,7 +1481,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
1480 right = alloc_arg(); 1481 right = alloc_arg();
1481 arg->op.right = right; 1482 arg->op.right = right;
1482 1483
1483 free_token(token); 1484 /* do not free the token, it belongs to an op */
1485 *tok = NULL;
1484 type = process_arg(event, right, tok); 1486 type = process_arg(event, right, tok);
1485 1487
1486 } else if (strcmp(token, "?") == 0) { 1488 } else if (strcmp(token, "?") == 0) {