From patchwork Thu Dec 28 20:35:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13506192 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 943C71079C for ; Thu, 28 Dec 2023 20:36:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D91F5C433CC; Thu, 28 Dec 2023 20:36:25 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rIx7z-00000000Dsj-2d8f; Thu, 28 Dec 2023 15:37:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (Google)" Subject: [PATCH 04/23] libtracefs: Free buf in clear_func_filter() Date: Thu, 28 Dec 2023 15:35:26 -0500 Message-ID: <20231228203714.53294-5-rostedt@goodmis.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231228203714.53294-1-rostedt@goodmis.org> References: <20231228203714.53294-1-rostedt@goodmis.org> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Steven Rostedt (Google)" The buf variable was allocated via tracefs_instance_file_read() but must be freed with free(). Fixes: 789e82d7 ("libtracefs: New API to reset ftrace instance") Signed-off-by: Steven Rostedt (Google) --- src/tracefs-instance.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tracefs-instance.c b/src/tracefs-instance.c index c385a078ecec..2efcc75dfd98 100644 --- a/src/tracefs-instance.c +++ b/src/tracefs-instance.c @@ -1371,6 +1371,7 @@ static void clear_func_filter(struct tracefs_instance *instance, const char *fil filter[len+1] = '\0'; tracefs_instance_file_append(instance, file, filter); } + free(buf); } static void clear_func_filters(struct tracefs_instance *instance)