Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756182AbeAJQNv (ORCPT + 1 other); Wed, 10 Jan 2018 11:13:51 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:57466 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754256AbeAJQNN (ORCPT ); Wed, 10 Jan 2018 11:13:13 -0500 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w0AGCxP4029227 X-Nifty-SrcIP: [209.85.213.52] X-Google-Smtp-Source: ACJfBouR3sOCv7jTOCmaOOLmQ/UjUyDRtF/UrEYYi0/x3upkAQgjaFcjCFQmrqa3JkTeLygWXKMtXqWLG2i9QVgZqFA= MIME-Version: 1.0 In-Reply-To: <1507482683-22651-6-git-send-email-ulfalizer@gmail.com> References: <1507482683-22651-1-git-send-email-ulfalizer@gmail.com> <1507482683-22651-6-git-send-email-ulfalizer@gmail.com> From: Masahiro Yamada Date: Thu, 11 Jan 2018 01:12:18 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5/6] kconfig: Don't leak help strings during parsing To: Ulf Magnusson Cc: "Yann E. MORIN" , Linux Kbuild mailing list , Sam Ravnborg , zippel@linux-m68k.org, Nicolas Pitre , Michal Marek , dirk@gouders.net, Arnaud Lacombe , walch.martin@web.de, Jan Beulich , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 2017-10-09 2:11 GMT+09:00 Ulf Magnusson : > This is just for completeness to get rid of the last memory leak > currently generated during parsing for ARCH=x86. The symbol > DVB_NETUP_UNIDVB in drivers/media/pci/netup_unidvb/Kconfig currently has > two help strings, and we leak the first one. Looks like it was fixed by 561b29e4ec8d0aac7e094f70d649ee4abccdda03 > Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix: > > LEAK SUMMARY: > definitely lost: 344,440 bytes in 14,350 blocks > ... > > Summary after the fix: > > LEAK SUMMARY: > definitely lost: 344,376 bytes in 14,349 blocks > ... > > Signed-off-by: Ulf Magnusson > --- > scripts/kconfig/zconf.y | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y > index 468ab03..3c9f436 100644 > --- a/scripts/kconfig/zconf.y > +++ b/scripts/kconfig/zconf.y > @@ -435,6 +435,9 @@ help_start: T_HELP T_EOL > > help: help_start T_HELPTEXT > { > + if (current_entry->help) > + /* Weird menu node with two help strings */ > + free(current_entry->help); > current_entry->help = $2; > }; I applied this, but maybe is it better to warning message? zconfprint("warning: ...") or zconf_error()? If you send v2, I will replace this. -- Best Regards Masahiro Yamada