diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2016-02-23 17:55:35 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-02-23 17:55:35 -0500 |
commit | ee79132e06852213646775fdfd591616e666bb44 (patch) | |
tree | f41bc215326d07ed676c6c63f8469a372b86793a | |
parent | 492069a1cc8a88ef9adf374d8a1e6ba1cf2d884b (diff) | |
download | trace-cmd-ee79132e06852213646775fdfd591616e666bb44.tar.gz |
trace-cmd profile: Handle NULL case in handle_fgraph_exit_event()
If there's no memory available, handle_end_event() will return a NULL task,
which needs to be checked before it is dereferenced.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-profile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/trace-profile.c b/trace-profile.c index 7911ca1b..0b0444db 100644 --- a/trace-profile.c +++ b/trace-profile.c @@ -1179,6 +1179,8 @@ static int handle_fgraph_exit_event(struct handle_data *h, struct task_data *task; task = handle_end_event(h, event_data, record, pid); + if (!task) + return -1; /* Do not match stacks with function graph exit events */ task->last_event = NULL; |