diff options
author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-10-08 19:35:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-26 11:02:08 +0200 |
commit | 18004e6f26ec406ee762fd3f8cceaf4ab5acde41 (patch) | |
tree | fb831a976dfd2ed9889788769e6a7f2918ce1d47 /scripts | |
parent | 0f511f3dda8c6fb2c799eab22acfb39056047a49 (diff) | |
download | linux-exynos-18004e6f26ec406ee762fd3f8cceaf4ab5acde41.tar.gz linux-exynos-18004e6f26ec406ee762fd3f8cceaf4ab5acde41.tar.bz2 linux-exynos-18004e6f26ec406ee762fd3f8cceaf4ab5acde41.zip |
kconfig: Fix expr_free() E_NOT leak
[ Upstream commit 5b1374b3b3c2fc4f63a398adfa446fb8eff791a4 ]
Only the E_NOT operand and not the E_NOT node itself was freed, due to
accidentally returning too early in expr_free(). Outline of leak:
switch (e->type) {
...
case E_NOT:
expr_free(e->left.expr);
return;
...
}
*Never reached, 'e' leaked*
free(e);
Fix by changing the 'return' to a 'break'.
Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
LEAK SUMMARY:
definitely lost: 44,448 bytes in 1,852 blocks
...
Summary after the fix:
LEAK SUMMARY:
definitely lost: 1,608 bytes in 67 blocks
...
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index cbf4996dd9c1..ed29bad1f03a 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -113,7 +113,7 @@ void expr_free(struct expr *e) break; case E_NOT: expr_free(e->left.expr); - return; + break; case E_EQUAL: case E_GEQ: case E_GTH: |