[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-03cd20949964f5cda600a56e12ffac39dfec4cb0@git.kernel.org>
Date: Thu, 24 Jan 2013 10:39:36 -0800
From: tip-bot for Namhyung Kim <namhyung.kim@....com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, hpa@...or.com,
mingo@...nel.org, andi@...stfloor.org, peterz@...radead.org,
namhyung.kim@....com, namhyung@...nel.org, tglx@...utronix.de,
feng.tang@...el.com
Subject: [tip:perf/core] perf session:
Free environment information when deleting session
Commit-ID: 03cd20949964f5cda600a56e12ffac39dfec4cb0
Gitweb: http://git.kernel.org/tip/03cd20949964f5cda600a56e12ffac39dfec4cb0
Author: Namhyung Kim <namhyung.kim@....com>
AuthorDate: Wed, 21 Nov 2012 13:43:19 +0900
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Sun, 9 Dec 2012 08:46:05 -0300
perf session: Free environment information when deleting session
The perf session environment information was saved (so allocated) during
perf_session__open, but was not freed. As free(3) handles NULL pointer
input properly it won't cause a issue for writing modes - e.g. perf
record
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: Feng Tang <feng.tang@...el.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/1353472999-23042-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ce6f511..d5fb607 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -204,11 +204,28 @@ static void perf_session__delete_threads(struct perf_session *session)
machine__delete_threads(&session->host_machine);
}
+static void perf_session_env__delete(struct perf_session_env *env)
+{
+ free(env->hostname);
+ free(env->os_release);
+ free(env->version);
+ free(env->arch);
+ free(env->cpu_desc);
+ free(env->cpuid);
+
+ free(env->cmdline);
+ free(env->sibling_cores);
+ free(env->sibling_threads);
+ free(env->numa_nodes);
+ free(env->pmu_mappings);
+}
+
void perf_session__delete(struct perf_session *self)
{
perf_session__destroy_kernel_maps(self);
perf_session__delete_dead_threads(self);
perf_session__delete_threads(self);
+ perf_session_env__delete(&self->header.env);
machine__exit(&self->host_machine);
close(self->fd);
free(self);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists