mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 03:44:55 +00:00
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>
This commit is contained in:
parent
a40b2dff7b
commit
09a788624d
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue