From patchwork Tue Feb 20 11:40:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 128870 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4541066ljc; Tue, 20 Feb 2018 03:42:19 -0800 (PST) X-Google-Smtp-Source: AH8x225aEoFbUcyHg4gbdHL0M/7cBeKtmRTKTNrwYkAW90aG3l1mzGIDg3Stjjxl+gDpL9OieG9S X-Received: by 2002:a17:902:8487:: with SMTP id c7-v6mr17077267plo.7.1519126939613; Tue, 20 Feb 2018 03:42:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519126939; cv=none; d=google.com; s=arc-20160816; b=SdAJKE7QCi/RSVTjK33EO0WklRXthfQivFpicHSWY/AQ3mU7qfhyJO0XekHLu4Ibc8 xqo/KRnMRhwEjvD6QGb0qXf8t1KrbGRfY10hD6Zbh7fzHaNiJxkJ3bZsu/qFncPW++Cp psfPW5H3K24rBBPxy7gMtjckYayZZHnjudHcF4DnI4jRY0797pnOrG2guuUiOsVndrFK youKDLVyv6guSjpf9yVLvsIs0Or+TZTXghwjnsOg8okePrPNbJ+DrPi/qSNq7jZJuQBF EF+DRMVcBdqHdSujzcTtRS3nBctX/o4l9ZBYVibOkgnhkbL/5MU9zfgtxIy5YlTeShXX M/oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=KHNqOXSs+RqAmiqXesOiZYZZLzvzGK81mo2EHgv72xs=; b=o5xkt3GyLokfIUxiEadfreDbyS62N772acxABNGluNIZcUIDyQkkj9QaLceRXQJxTB CszWHHiCI9Z/PNhJftrjOTWc3nmXuhBA4Hz21K58akoY+dTJTElPHtu7/VKnyXdD7gIx 23OmbYgAlTHNsDfS7ydkkxbGwJgG/9TWizGTQ8TFjThcJrJjQhDDPvbQxnE5kPbrKwZO fOWXZonRwIzX2sQMy2IwFBmKT/eA15QcavgmPzjnC0SrpX41jd8vfgJguaujQZsMYtz5 5eR/M7dFAKumJlkK/B8BCOAeQHHDMCIPhPahZpOCqWdaKXmXGNP+Q0LydcOPJcxwhrEj gXRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=dncVa9Pv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r89si2507016pfk.52.2018.02.20.03.42.06; Tue, 20 Feb 2018 03:42:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=dncVa9Pv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751520AbeBTLlv (ORCPT + 28 others); Tue, 20 Feb 2018 06:41:51 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:43752 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbeBTLlq (ORCPT ); Tue, 20 Feb 2018 06:41:46 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w1KBeVbJ032618; Tue, 20 Feb 2018 20:40:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w1KBeVbJ032618 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519126833; bh=KHNqOXSs+RqAmiqXesOiZYZZLzvzGK81mo2EHgv72xs=; h=From:To:Cc:Subject:Date:From; b=dncVa9Pv0+hi2NSw16sQhOZp4XSS8dpezHVYLc65qsbqD+B+coMDBQUjdBMvSSIQj FQATQUxk9j3j7ISjYHurF5Pz5hhaM24IW+ibcw0OrLCrZnwT1bI7Qy1juQC+/aZygA pPsnmx+BGRquic0IR3cqlcWaOlcdvHhyyRUdNc+35w8ZbXgVAokVijnI+a0Q/pDKv4 ZLZxVMSZ8SSJYq4czETCoxTbLGjLgdTpxtswFNjVnQGEjUlug4RLv1Xr3KdKj6qYk1 sfbgx3K3keuon2/jX5evQrMCPgvwckci/0AbJCo9qgABpT4WyzVn/WB6SkZgKpZ5C/ 5BbsaPccoOu8A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , Ulf Magnusson , Randy Dunlap , Masahiro Yamada , "Luis R. Rodriguez" , linux-kernel@vger.kernel.org Subject: [PATCH] kconfig: Don't leak choice names during parsing Date: Tue, 20 Feb 2018 20:40:29 +0900 Message-Id: <1519126829-7257-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The named choice is not used in the kernel tree, but if it were used, it would not be freed. The intention of the named choice can be seen in the log of commit 5a1aa8a1aff6 ("kconfig: add named choice group"). There is room for argument if this is useful in practice, but anyway I am fixing the memory leak. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 Reviewed-by: Ulf Magnusson diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 4be9805..4893676 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -276,6 +276,7 @@ choice: T_CHOICE word_opt T_EOL sym->flags |= SYMBOL_AUTO; menu_add_entry(sym); menu_add_expr(P_CHOICE, NULL, NULL); + free($2); printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); };