Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp623205pxb; Tue, 5 Apr 2022 16:17:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy++qFS5GkPQWEUwL1nozBn7/dotK45PX5Lo5kuuSoP2rTS4uyfjv6r4bUpYOdxT3k03k6z X-Received: by 2002:a17:902:ce04:b0:156:3be:8a86 with SMTP id k4-20020a170902ce0400b0015603be8a86mr5973701plg.152.1649200670212; Tue, 05 Apr 2022 16:17:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649200670; cv=none; d=google.com; s=arc-20160816; b=v4yg/ZCNOTKzZMQCqPsZU0sxR7pQK4ozQCYKZI84SJsRTQd8a9UX7T1uJ0gV5STexB Br2EYufj17vzzEHPW2pTVNP3Qpm1mIy99zmQDsJos2pWEJKklyx5hVAK2TZbVsFf73UZ sDoHRqKD9O13tIT5LMiQJO1GT+5EzYI7rEmuIrMVPf+pp7Sk1vMw7nmSS39f8f/pzcAk 3hucuN139LER69HuRI4icaOXZRFvOZ18/8unaHjgGJCwfV4Fh5Ishs/nK2ViQz/WTFpN E69copzA6IXiOpTyRy2StUO/CRMKwup8eEm8hhVJhkV6anL8gafxxbNiJnXGqynctzQn d1og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ptYm3U/B1x5gghICpBuK+UqJg6LcZgrrD8M/nIF3aeg=; b=grimjxSzPRmcJhXpA25qPWPuiWdwMkgGJ9YDsdQGwx6dOZoIorniYRw9Ro5iipRM0H Ni2x1Cse+N/rBE9vtiWtuN5XgvucivudvhY+BzjUrMiOtQ905ZCfvdRtBKZ8H/W1YBbo KM0PjqUQyhqy43Czwb0Qt2Se9Llq5JAFOjc8yIpSfHcjmOCbUuymiSYJzvuUvHvasNej 1q2T+FX3f16tj1z2J+foDhQs67VY1okQvQpiFatfcWKk+dsikITCEaiJrVExcSncT0lC 0MK6Rdk3PvZn/2w3BYZ64bGri3/lZOvbHPeRrTmciEdkUA53Q4c3hepG0qVHQEpMKzJu jn9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tKRUsMt+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z3-20020a63e543000000b003821f0d1b72si13872979pgj.701.2022.04.05.16.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:17:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tKRUsMt+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C8C102261E6; Tue, 5 Apr 2022 16:02:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377067AbiDELZ3 (ORCPT + 99 others); Tue, 5 Apr 2022 07:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242801AbiDEItd (ORCPT ); Tue, 5 Apr 2022 04:49:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B061A75602; Tue, 5 Apr 2022 01:37:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id CB675B81C15; Tue, 5 Apr 2022 08:37:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30787C385A7; Tue, 5 Apr 2022 08:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147847; bh=4JilkGpXUFStr7DuFbAb05Cf5KlVYYVNVPbAujUtgkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tKRUsMt+Ix78VulN/E/Kb9AWShbephKVVc+p5UnEjdeaB/l8FQTMteSIyKDZiSIyh xXJmj/b5Tsx8U7HORG8XA0YOnna1hJlQNmpAE60RKP4x6HJkQlyCyvg9xVdqS5p02a s8FZWqSal2SV87ux38BESKrBFzJyq7UJyDI/TXhY= 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=20Sala=C3=BCn?= Subject: [PATCH 5.16 0142/1017] samples/landlock: Fix path_list memory leak Date: Tue, 5 Apr 2022 09:17:35 +0200 Message-Id: <20220405070358.418907818@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; }