1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-24 09:13:20 -05:00
linux/scripts/kconfig
Masahiro Yamada ae1eff0349 kconfig: fix memory leak from range properties
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>
2023-11-17 13:24:08 +09:00
..
lxdialog kconfig: menuconfig: simplify global jump key assignment 2023-07-25 00:59:32 +09:00
tests
.gitignore
conf.c
confdata.c kconfig: add warn-unknown-symbols sanity check 2023-09-01 16:38:04 +09:00
expr.c
expr.h kconfig: menuconfig: remove jump_key::index 2023-07-25 00:59:32 +09:00
gconf-cfg.sh
gconf.c kconfig: gconfig: correct program name in help text 2023-07-12 23:46:57 +09:00
gconf.glade
images.c
images.h
internal.h
lexer.l
list.h
lkc.h kconfig: menuconfig: simplify global jump key assignment 2023-07-25 00:59:32 +09:00
lkc_proto.h
Makefile kbuild: Show marked Kconfig fragments in "help" 2023-09-04 02:04:20 +09:00
mconf-cfg.sh
mconf.c kconfig: menuconfig: remove jump_key::index 2023-07-25 00:59:32 +09:00
menu.c kconfig: menuconfig: remove jump_key::index 2023-07-25 00:59:32 +09:00
merge_config.sh
nconf-cfg.sh
nconf.c kconfig: nconf: Add search jump feature 2023-08-13 21:29:41 +09:00
nconf.gui.c kconfig: nconf: Add search jump feature 2023-08-13 21:29:41 +09:00
nconf.h kconfig: nconf: Add search jump feature 2023-08-13 21:29:41 +09:00
parser.y
preprocess.c kconfig: fix possible buffer overflow 2023-09-06 02:00:02 +09:00
qconf-cfg.sh kconfig: port qconf to work with Qt6 in addition to Qt5 2023-08-16 12:06:29 +09:00
qconf.cc kconfig: port qconf to work with Qt6 in addition to Qt5 2023-08-16 12:06:29 +09:00
qconf.h
streamline_config.pl
symbol.c kconfig: fix memory leak from range properties 2023-11-17 13:24:08 +09:00
util.c