!717 fix:ping命令访问野指针及内存泄漏问题修复

Merge pull request !717 from Zhaotianyu/cherry-pick-1655456538
This commit is contained in:
openharmony_ci 2022-06-20 06:47:35 +00:00 committed by Gitee
commit e4ae10d163
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -600,7 +600,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 {
@ -616,6 +615,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();