Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbbLCWeY (ORCPT ); Thu, 3 Dec 2015 17:34:24 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35036 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbbLCWeW (ORCPT ); Thu, 3 Dec 2015 17:34:22 -0500 Date: Thu, 3 Dec 2015 23:34:13 +0100 (CET) From: John Kacur X-X-Sender: jkacur@riemann To: Steven Rostedt cc: LKML Subject: [PATCH] trace-cmd: trace-cmd.c call free only once on tracing and path Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 47 >From 33102b6423ba64798d91aee9de4ecb21189dd49e Mon Sep 17 00:00:00 2001 From: John Kacur 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 Signed-off-by: John Kacur --- trace-recorder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trace-recorder.c b/trace-recorder.c index 540765bc9c65..cfdc45e053ab 100644 --- a/trace-recorder.c +++ b/trace-recorder.c @@ -97,15 +97,15 @@ struct tracecmd_recorder *tracecmd_create_recorder_fd(int fd, int cpu, unsigned if (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: -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/