Commit f4a21b2f99cf8d977d9a0b270e4c997f623e74e9

Authored by Peng Fan
Committed by guoyin.chen
1 parent ac2195a85d

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>
(cherry picked from commit 09a788624dbe32aeeb0d74c97c0965303eb96d8c)

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -102,9 +102,9 @@
102 102 * is pretty rare.
103 103 */
104 104 rcode = cli_simple_run_command_list(buff, flag);
  105 +#endif
105 106 if (need_buff)
106 107 free(buff);
107   -#endif
108 108  
109 109 return rcode;
110 110 }