提交 0245b1a7 编写于 作者: W wangchen

fix: shell 输入不识别命令时内存泄漏

【背景】shell 输入不识别命令时内存泄漏

【修改方案】
1,添加识别命令失败时释放内存

【影响】
对现有的产品编译不会有影响。

re #I4UR9P
Signed-off-by: Nwangchen <wangchen64@huawei.com>
上级 d4d59cf0
......@@ -157,6 +157,7 @@ STATIC VOID ParseAndExecCmdline(CmdParsed *cmdParsed, const CHAR *cmdline, UINT3
ret = ShellMsgTypeGet(cmdParsed, cmdName);
if (ret != LOS_OK) {
PRINTK("%s:command not found\n", cmdName);
free(cmdName);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册