Skip to content
Snippets Groups Projects
Commit 09a78862 authored by Peng Fan's avatar Peng Fan Committed by Tom Rini
Browse files

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: default avatarPeng Fan <peng.fan@nxp.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Simon Glass <sjg@chromium.org>
parent a40b2dff
No related branches found
No related tags found
No related merge requests found
...@@ -103,9 +103,9 @@ int run_command_list(const char *cmd, int len, int flag) ...@@ -103,9 +103,9 @@ int run_command_list(const char *cmd, int len, int flag)
* is pretty rare. * is pretty rare.
*/ */
rcode = cli_simple_run_command_list(buff, flag); rcode = cli_simple_run_command_list(buff, flag);
#endif
if (need_buff) if (need_buff)
free(buff); free(buff);
#endif
return rcode; return rcode;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment