diff options
author | Peng Fan <peng.fan@nxp.com> | 2015-12-22 09:14:13 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-04 17:25:35 (GMT) |
commit | 09a788624dbe32aeeb0d74c97c0965303eb96d8c (patch) | |
tree | 4cdba3e789223ca57cfa2e791fe247982d1a146d /common | |
parent | a40b2dff7bec6c1656a59ce31c16207b8954eb68 (diff) | |
download | u-boot-09a788624dbe32aeeb0d74c97c0965303eb96d8c.tar.xz |
common: cli: avoid memory leak
Whether CONFIG_SYS_HUSH_PARSER is defined or not, should always
check to free 'buff' to avoid memory leak.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/cli.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cli.c b/common/cli.c index fbcd339..119d282 100644 --- a/common/cli.c +++ b/common/cli.c @@ -103,9 +103,9 @@ int run_command_list(const char *cmd, int len, int flag) * is pretty rare. */ rcode = cli_simple_run_command_list(buff, flag); +#endif if (need_buff) free(buff); -#endif return rcode; } |