Skip to content

Commit

Permalink
perf tools: Fix parse_events_terms() segfault on error path
Browse files Browse the repository at this point in the history
On the error path, 'data.terms' may not have been initialised.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1372944040-32690-5-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed Jul 8, 2013
1 parent 7cab84e commit b2c34fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
@@ -860,7 +860,8 @@ int parse_events_terms(struct list_head *terms, const char *str)
return 0;
}

parse_events__free_terms(data.terms);
if (data.terms)
parse_events__free_terms(data.terms);
return ret;
}

0 comments on commit b2c34fd

Please sign in to comment.