projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a40b2df
)
common: cli: avoid memory leak
author
Peng Fan
<peng.fan@nxp.com>
Tue, 22 Dec 2015 09:14:13 +0000
(17:14 +0800)
committer
Tom Rini
<trini@konsulko.com>
Mon, 4 Jan 2016 17:25:35 +0000
(12:25 -0500)
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>
common/cli.c
patch
|
blob
|
history
diff --git
a/common/cli.c
b/common/cli.c
index fbcd339c9beeb2998c68876f942811426c060682..119d282bc240d82ba4cfcc050c1cb5c118709cb1 100644
(file)
--- 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;
}