]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tools lib traceevent: Copy trace_clock and free it
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 24 Mar 2015 13:57:50 +0000 (09:57 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Mar 2015 15:11:19 +0000 (12:11 -0300)
commit99ad1417db2e83530b88e3eff1a40285d6ebfee9
tree20e1f266226b4cef56283c5c1a6a0b5799d467b2
parentdeab6f55a2fe6fe044af61c9aad6a8e90cda6499
tools lib traceevent: Copy trace_clock and free it

The pevent->trace_clock should not be a direct pointer to what was
given. It should be copied and freed.

Note, valgrind pointed this out when a caller passed in a pointer that
needed to be freed and it never was. Ideally, pevent should copy it
(which this change does), and free the copy. It's up to the caller to
free the clock string passed in.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135922.695906738@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.c
tools/lib/traceevent/event-parse.h