lkml.org 
[lkml]   [2017]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/6] kconfig: Don't leak help strings during parsing
Date
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.

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 <ulfalizer@gmail.com>
---
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;
};

--
2.7.4
\
 
 \ /
  Last update: 2017-10-08 19:13    [W:0.211 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site