android_kernel_motorola_sm6375/scripts/kconfig
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Masahiro Yamada d162a5e6a5 kconfig: fix memory leak from range properties
[ Upstream commit ae1eff0349f2e908fc083630e8441ea6dc434dc0 ]

Currently, sym_validate_range() duplicates the range string using
xstrdup(), which is overwritten by a subsequent sym_calc_value() call.
It results in a memory leak.

Instead, only the pointer should be copied.

Below is a test case, with a summary from Valgrind.

[Test Kconfig]

  config FOO
          int "foo"
          range 10 20

[Test .config]

  CONFIG_FOO=0

[Before]

  LEAK SUMMARY:
     definitely lost: 3 bytes in 1 blocks
     indirectly lost: 0 bytes in 0 blocks
       possibly lost: 0 bytes in 0 blocks
     still reachable: 17,465 bytes in 21 blocks
          suppressed: 0 bytes in 0 blocks

[After]

  LEAK SUMMARY:
     definitely lost: 0 bytes in 0 blocks
     indirectly lost: 0 bytes in 0 blocks
       possibly lost: 0 bytes in 0 blocks
     still reachable: 17,462 bytes in 20 blocks
          suppressed: 0 bytes in 0 blocks

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:18:10 +01:00
..
lxdialog
tests
.gitignore
conf.c
confdata.c kconfig: fix failing to generate auto.conf 2022-02-23 12:00:01 +01:00
expr.c
expr.h
gconf-cfg.sh
gconf.c
gconf.glade
images.c
images.h
lexer.l
list.h
lkc.h
lkc_proto.h
Makefile
mconf-cfg.sh
mconf.c
menu.c
merge_config.sh
nconf-cfg.sh
nconf.c kconfig: nconf: stop endless search loops 2021-05-19 10:08:23 +02:00
nconf.gui.c
nconf.h
parser.y
preprocess.c kconfig: fix possible buffer overflow 2023-09-23 10:59:57 +02:00
qconf-cfg.sh
qconf.cc kconfig: qconf: fix signal connection to invalid slots 2020-08-26 10:41:04 +02:00
qconf.h
streamline_config.pl
symbol.c kconfig: fix memory leak from range properties 2023-12-13 18:18:10 +01:00
util.c