All of lore.kernel.org
 help / color / mirror / Atom feed
* [perf PATCH 1/3] Fix memory leak on error
@ 2013-01-25 10:20 Thomas Jarosch
  2013-01-31 11:02 ` [tip:perf/core] perf tools: " tip-bot for Thomas Jarosch
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Jarosch @ 2013-01-25 10:20 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel

cppcheck reported:
[util/event.c:480]: (error) Memory leak: event

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 tools/perf/util/event.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 3cf2c3e..5cd13d7 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -476,8 +476,10 @@ int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
 		}
 	}
 
-	if (kallsyms__parse(filename, &args, find_symbol_cb) <= 0)
+	if (kallsyms__parse(filename, &args, find_symbol_cb) <= 0) {
+		free(event);
 		return -ENOENT;
+	}
 
 	map = machine->vmlinux_maps[MAP__FUNCTION];
 	size = snprintf(event->mmap.filename, sizeof(event->mmap.filename),
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf tools: Fix memory leak on error
  2013-01-25 10:20 [perf PATCH 1/3] Fix memory leak on error Thomas Jarosch
@ 2013-01-31 11:02 ` tip-bot for Thomas Jarosch
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Thomas Jarosch @ 2013-01-31 11:02 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, thomas.jarosch, tglx

Commit-ID:  0b9e01a4f0d1c8277da6824fe060ccb0434d2fde
Gitweb:     http://git.kernel.org/tip/0b9e01a4f0d1c8277da6824fe060ccb0434d2fde
Author:     Thomas Jarosch <thomas.jarosch@intra2net.com>
AuthorDate: Fri, 25 Jan 2013 11:20:47 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 30 Jan 2013 10:40:05 -0300

perf tools: Fix memory leak on error

cppcheck reported:
[util/event.c:480]: (error) Memory leak: event

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Link: http://lkml.kernel.org/r/2717013.8dV0naNhAV@storm
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 3cf2c3e..5cd13d7 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -476,8 +476,10 @@ int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
 		}
 	}
 
-	if (kallsyms__parse(filename, &args, find_symbol_cb) <= 0)
+	if (kallsyms__parse(filename, &args, find_symbol_cb) <= 0) {
+		free(event);
 		return -ENOENT;
+	}
 
 	map = machine->vmlinux_maps[MAP__FUNCTION];
 	size = snprintf(event->mmap.filename, sizeof(event->mmap.filename),

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-31 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 10:20 [perf PATCH 1/3] Fix memory leak on error Thomas Jarosch
2013-01-31 11:02 ` [tip:perf/core] perf tools: " tip-bot for Thomas Jarosch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.