Skip to content

Commit

Permalink
perf tools: Add missing check for failure in a zalloc() call
Browse files Browse the repository at this point in the history
Signed-off-by: Taeung Song <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Taeung authored and acmel committed Feb 8, 2017
1 parent 75fc5ae commit 5aa365f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
closedir(evt_dir);
closedir(sys_dir);
path = zalloc(sizeof(*path));
if (!path)
return NULL;
path->system = malloc(MAX_EVENT_LENGTH);
if (!path->system) {
free(path);
Expand Down

0 comments on commit 5aa365f

Please sign in to comment.