aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2014-04-22 19:23:30 -0400
committerShow Liu <show.liu@linaro.org>2014-06-18 12:03:34 +0800
commitc1328a6fdf3c6a4c24a80e96a98191d055182d91 (patch)
tree0e1512694cdacd48370f64cb174e6ff0af0503c7 /tools
parent5c5149fd7dc3eb141a0fcfc7d2ceac056b276766 (diff)
tools lib traceevent: Fix memory leak in pretty_print()
commit de04f8657de9d3351a2d5880f1f7080b23b798cf upstream. Commit 12e55569a244 "tools lib traceevent: Use helper trace-seq in print functions like kernel does" added a extra trace_seq helper to process string arguments like the kernel does it. But the difference between the kernel and the userspace library is that the kernel's trace_seq structure has a static allocated buffer. The userspace one has a dynamically allocated one. It requires a trace_seq_destroy(), otherwise it produces a nasty memory leak. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20140422192330.6bb09bf8@gandalf.local.home Signed-off-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/traceevent/event-parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 1587ea392ad..30e8e0c3f11 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4321,6 +4321,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
format, len_arg, arg);
trace_seq_terminate(&p);
trace_seq_puts(s, p.buffer);
+ trace_seq_destroy(&p);
arg = arg->next;
break;
default: