Commit: 80c56880c8f7d1958f66142750908e819e234968
Parent: 5aa0dd42f7b45b5ef2bceb8510aeb2a892866abf
Author: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2018-03-19 07:45:22
Tree: 658f08c354b62d4e2e0b97ae1a8399c4ef131e3b

shared/shell: Fix memory leak by generator for submenu Since asprintf() allocates new memory when a submenu command is complemented, the memory leak occurs as below: 8 bytes in 1 blocks are definitely lost in loss record 18 of 179 at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x5679C99: strdup (strdup.c:42) by 0x13B1E7: find_cmd.constprop.2 (shell.c:597) by 0x13B2D1: cmd_generator (shell.c:646) by 0x53B976D: rl_completion_matches (in /lib/x86_64-linux-gnu/libreadline.so.7.0) by 0x13BA91: shell_completion (shell.c:777) by 0x53B98B6: ??? (in /lib/x86_64-linux-gnu/libreadline.so.7.0) by 0x53B9A99: rl_complete_internal (in /lib/x86_64-linux-gnu/libreadline.so.7.0) by 0x53B02EE: _rl_dispatch_subseq (in /lib/x86_64-linux-gnu/libreadline.so.7.0) by 0x53B07B5: readline_internal_char (in /lib/x86_64-linux-gnu/libreadline.so.7.0) by 0x53C8F84: rl_callback_read_char (in /lib/x86_64-linux-gnu/libreadline.so.7.0) by 0x13AD80: input_read (shell.c:1065)

Diffstat

M src/shared/shell.c | 8 +++++++-

1 files changed, 7 insertions(+), 1 deletions(-)

View Full Diff | Patch