Skip to content

Commit 5b1374b

Browse files
ulfalizermasahir0y
authored andcommitted
kconfig: Fix expr_free() E_NOT leak
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>
1 parent ae7440e commit 5b1374b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/kconfig/expr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void expr_free(struct expr *e)
113113
break;
114114
case E_NOT:
115115
expr_free(e->left.expr);
116-
return;
116+
break;
117117
case E_EQUAL:
118118
case E_GEQ:
119119
case E_GTH:

0 commit comments

Comments
 (0)