From patchwork Tue Apr 5 07:14:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 558232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 456EAC433EF for ; Tue, 5 Apr 2022 07:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbiDEHw3 (ORCPT ); Tue, 5 Apr 2022 03:52:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbiDEHuj (ORCPT ); Tue, 5 Apr 2022 03:50:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C5C939B6; Tue, 5 Apr 2022 00:47:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 64204616D7; Tue, 5 Apr 2022 07:47:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7412EC3410F; Tue, 5 Apr 2022 07:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144827; bh=4JilkGpXUFStr7DuFbAb05Cf5KlVYYVNVPbAujUtgkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1h1qLZdS8uttyK6PiR9wJpC1KWpTMucOg72iqvbbO+fciGvmsUKRnLr/bgWKtRj3f rtWPtQ54M1aHW7W+misb6JPrR5hpT3YxP2BBfmVFYt8tnSJ8eaP7EFYnxGj5oIp5RQ NKbXxhzQ7OEticl4d5AiQ8903i0dPRi1fI0BqMnQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= Subject: [PATCH 5.17 0137/1126] samples/landlock: Fix path_list memory leak Date: Tue, 5 Apr 2022 09:14:44 +0200 Message-Id: <20220405070411.599909869@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tom Rix commit 66b513b7c64a7290c1fbb88e657f7cece992e131 upstream. Clang static analysis reports this error sandboxer.c:134:8: warning: Potential leak of memory pointed to by 'path_list' ret = 0; ^ path_list is allocated in parse_path() but never freed. Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20210428213852.2874324-1-trix@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Signed-off-by: Greg Kroah-Hartman --- samples/landlock/sandboxer.c | 1 + 1 file changed, 1 insertion(+) --- a/samples/landlock/sandboxer.c +++ b/samples/landlock/sandboxer.c @@ -134,6 +134,7 @@ static int populate_ruleset( ret = 0; out_free_name: + free(path_list); free(env_path_name); return ret; }