aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-29 16:57:45 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-29 16:57:45 -0500
commit502e561860d189c60cd46e3937b38b6b142d2ec8 (patch)
treed282f713c1490f2a9b9253cb4a27c67e4ba252b0
parent7e5958dd17125eb2c2724644f2e42d7228417af7 (diff)
trace-cmd: Make print op NULL on error of processing arg
If the processing of an arg fails, it frees the given token. But in this case, the token happens to also be assigned to an op. If the parsing fails, then the op may be freed twice causing glibc to abort. Reported-by: John Kacur <jkacur@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--parse-events.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse-events.c b/parse-events.c
index 9f88472..53aad3e 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -2183,6 +2183,11 @@ process_arg_token(struct event_format *event, struct print_arg *arg,
2183 arg->op.op = token; 2183 arg->op.op = token;
2184 arg->op.left = NULL; 2184 arg->op.left = NULL;
2185 type = process_op(event, arg, &token); 2185 type = process_op(event, arg, &token);
2186
2187 /* On error, the op is freed */
2188 if (type == EVENT_ERROR)
2189 arg->op.op = NULL;
2190
2186 /* return error type if errored */ 2191 /* return error type if errored */
2187 break; 2192 break;
2188 2193