提交 0b9e01a4 编写于 作者: T Thomas Jarosch 提交者: Arnaldo Carvalho de Melo

perf tools: Fix memory leak on error

cppcheck reported:
[util/event.c:480]: (error) Memory leak: event
Signed-off-by: NThomas Jarosch <thomas.jarosch@intra2net.com>
Link: http://lkml.kernel.org/r/2717013.8dV0naNhAV@stormSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 8eb44dd7
......@@ -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),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册