fixed d837ed3 from https://gitee.com/arvinzzz/kernel_liteos_m/pulls/716
fix: ping命令内访问野指针及内存泄漏

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
This commit is contained in:
arvinzzz 2022-06-17 16:54:51 +08:00 committed by Zhaotianyu
parent 4334b3e18b
commit d8e42158bd
1 changed files with 2 additions and 1 deletions

View File

@ -586,7 +586,6 @@ u32_t OsShellPing(int argc, const char **argv)
stPingTask.uwArg = (UINTPTR)parg;
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
if (ret != LOS_OK) {
free(parg);
PRINTK("ping_task create failed 0x%08x.\n", ret);
count = LWIP_SHELL_CMD_PING_RETRY_TIMES;
} else {
@ -602,6 +601,8 @@ u32_t OsShellPing(int argc, const char **argv)
PRINTK("Ping cmd failed due some errors\n");
}
free(parg);
return LOS_OK;
ping_error:
lwip_ping_usage();