trace-cmd: trace-cmd.c call free only once on tracing and path
PATCH 1/1 trace-cmd: trace-cmd.c call free only once on tracing and path
Quoted 1 line
From
33102b6423ba64798d91aee9de4ecb21189dd49eMon Sep 17 00:00:00 2001
From: John Kacur <[email protected]>
Date: Thu, 3 Dec 2015 23:29:05 +0100
Subject: [PATCH] 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
--- trace-recorder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
trace-recorder.c +3 -3
@@ -97,15 +97,15 @@ struct tracecmd_recorder *tracecmd_create_recorder_fd(int fd, int cpu, unsignedif (recorder->trace_fd <0 ) goto out_free; -free (tracing); -free (path); -if ((recorder->flags &TRACECMD_RECORD_NOSPLICE ) ==0 ) { ret =pipe (recorder->brass);if (ret <0 ) goto out_free; } +free (tracing); +free (path); +return recorder; out_free:
Signature · 1 line
2.4.3
Steven Rostedt
AppliedQuoted 10 lines · On Thu, 3 Dec 2015 23:34:13 +0100 (CET) John Kacur <[email protected]> wrote:
Quoted 1 line
From
33102b6423ba64798d91aee9de4ecb21189dd49eMon Sep 17 00:00:00 2001From: John Kacur <[email protected]>
Date: Thu, 3 Dec 2015 23:29:05 +0100
Subject: [PATCH] trace-cmd: don't call free on tracing and path more than onceIn 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
Applied to upstream. I'll have to go and back port patches for the stable releases too.
Thanks,
-- Steve