[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1464715609-12401-3-git-send-email-treeze.taeung@gmail.com>
Date: Wed, 1 Jun 2016 02:26:42 +0900
From: Taeung Song <treeze.taeung@...il.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Taeung Song <treeze.taeung@...il.com>,
Jiri Olsa <jolsa@...hat.com>
Subject: [BUGFIX][PATCH v5 2/9] perf config: Finally free a config set after collect_config() worked
Current colllect_config() free a config set on failure.
But it is needed to finally free it at perf_config_set__new()
after collect_config() worked.
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Signed-off-by: Taeung Song <treeze.taeung@...il.com>
---
tools/perf/util/config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index b500737..d013f90 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -639,7 +639,6 @@ static int collect_config(const char *var, const char *value,
out_free:
free(key);
- perf_config_set__delete(set);
return -1;
}
@@ -649,7 +648,8 @@ struct perf_config_set *perf_config_set__new(void)
if (set) {
INIT_LIST_HEAD(&set->sections);
- perf_config(collect_config, set);
+ if (perf_config(collect_config, set) < 0)
+ perf_config_set__delete(set);
}
return set;
--
2.5.0
Powered by blists - more mailing lists