From 2d4352c077b98215771cc081626c7a69289c4fac Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 3 Jan 2014 17:30:04 -0300 Subject: [PATCH] perf tests: Fixup leak on error path in parse events test We need to call the evlist destructor when failing to parse events. Cc: Adrian Hunter Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-ilslu69s7v7bpvdgqtrlp8f5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/parse-events.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index e4ce8ae..41dee5e 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1385,10 +1385,10 @@ static int test_event(struct evlist_test *e) if (ret) { pr_debug("failed to parse event '%s', err %d\n", e->name, ret); - return ret; + } else { + ret = e->check(evlist); } - - ret = e->check(evlist); + perf_evlist__delete(evlist); return ret; -- 2.7.4