diff options
author | John Kacur <jkacur@redhat.com> | 2015-12-03 23:29:05 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-02-23 16:53:40 -0500 |
commit | 908a6e96a55b75d3b53e35ee1b05b301b7612c75 (patch) | |
tree | 4ac3023097e26d9216be8fa79d43b1436444a3a8 | |
parent | 59c87643bf94b4af8e2c345165cbfe7febe15640 (diff) | |
download | trace-cmd-908a6e96a55b75d3b53e35ee1b05b301b7612c75.tar.gz |
trace-cmd: Don't call free on tracing and path more than once
In version trace-cmd-stable-v2.2 it is possible to call free on
tracing and path more than once.
Ensure this only happens once by moving this block to after the call
to out_free
Link: http://lkml.kernel.org/r/alpine.LFD.2.20.1512032331580.20385@riemann
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-recorder.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trace-recorder.c b/trace-recorder.c index 7e637d36..49b04ea4 100644 --- a/trace-recorder.c +++ b/trace-recorder.c @@ -167,14 +167,14 @@ tracecmd_create_buffer_recorder_fd2(int fd, int fd2, int cpu, unsigned flags, if (recorder->trace_fd < 0) goto out_free; - free(path); - if ((recorder->flags & TRACECMD_RECORD_NOSPLICE) == 0) { ret = pipe(recorder->brass); if (ret < 0) goto out_free; } + free(path); + return recorder; out_free: |