diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 2720600b13a9eac7a73831f4d3b6a8d4a33a8575..1f1f77d8d3abb44838360ad18fd99872a70fd5a1 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -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);