diff options
author | Thomas Jarosch <thomas.jarosch@intra2net.com> | 2013-01-25 05:20:47 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-30 08:40:05 -0500 |
commit | 0b9e01a4f0d1c8277da6824fe060ccb0434d2fde (patch) | |
tree | 70016430c90da177f7bceea1663c5318ae13a689 /tools | |
parent | 8eb44dd76ac994b020e5cfe72635c90d9e0ad995 (diff) |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/event.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 3cf2c3e0605f..5cd13d768cec 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, | |||
476 | } | 476 | } |
477 | } | 477 | } |
478 | 478 | ||
479 | if (kallsyms__parse(filename, &args, find_symbol_cb) <= 0) | 479 | if (kallsyms__parse(filename, &args, find_symbol_cb) <= 0) { |
480 | free(event); | ||
480 | return -ENOENT; | 481 | return -ENOENT; |
482 | } | ||
481 | 483 | ||
482 | map = machine->vmlinux_maps[MAP__FUNCTION]; | 484 | map = machine->vmlinux_maps[MAP__FUNCTION]; |
483 | size = snprintf(event->mmap.filename, sizeof(event->mmap.filename), | 485 | size = snprintf(event->mmap.filename, sizeof(event->mmap.filename), |