From 81d02b4feaa6f136e0fd141113b07176986d8ac0 Mon Sep 17 00:00:00 2001 From: pef Date: Thu, 25 Nov 2021 03:20:31 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=86=85=E5=AD=98=E9=87=8A?= =?UTF-8?q?=E6=94=BE=E5=87=BD=E6=95=B0=E5=92=8C=E5=8E=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E5=8F=82=E6=95=B0=E3=80=82=20=E3=80=90=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E3=80=91=201.=E6=9C=89=E6=89=8B=E5=8A=A8=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=86=85=E5=AD=98=E5=9C=A8return=E5=89=8D=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E3=80=82=202.PRINTK=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 1. 添加free(fullpath),释放内存。 2. 去掉多余参数。 【影响】 对现有的产品编译不会有影响。 Change-Id: Ifa74d5b443e98b03c10a34cca4ce6eaebfb2a120 Signed-off-by: pef --- components/shell/src/cmds/task_shellcmd.c | 7 ++----- components/shell/src/cmds/vfs_shellcmd.c | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/components/shell/src/cmds/task_shellcmd.c b/components/shell/src/cmds/task_shellcmd.c index 1b7e0d86..a759fda3 100755 --- a/components/shell/src/cmds/task_shellcmd.c +++ b/components/shell/src/cmds/task_shellcmd.c @@ -74,7 +74,6 @@ LITE_OS_SEC_TEXT_MINOR STATIC VOID OsShellCmdTskInfoData(const LosTaskCB *allTas { const LosTaskCB *taskCB = NULL; UINT32 loop; - UINT32 semId; #if (LOSCFG_TASK_MEM_USED == 1) UINT32 arraySize = sizeof(UINT32) * (LOSCFG_BASE_CORE_TSK_LIMIT + 1); @@ -93,17 +92,15 @@ LITE_OS_SEC_TEXT_MINOR STATIC VOID OsShellCmdTskInfoData(const LosTaskCB *allTas continue; } - semId = OsGetSemID(taskCB); - PRINTK("%-23s%-20p0x%-5x", taskCB->taskName, taskCB->taskEntry, taskCB->taskID); #if (LOSCFG_TASK_MEM_USED == 1) PRINTK("%-11u%-13s0x%-11x 0x%-11x 0x%-8x 0x%-10x ", taskCB->priority, OsConvertTskStatus(taskCB->taskStatus), getUsedSizeArray[loop], taskCB->stackSize, - taskCB->stackPointer, taskCB->topOfStack, semId); + taskCB->stackPointer, taskCB->topOfStack); #else PRINTK("%-11u%-13s0x%-11x 0x%-8x 0x%-10x ", taskCB->priority, OsConvertTskStatus(taskCB->taskStatus), taskCB->stackSize, - taskCB->stackPointer, taskCB->topOfStack, semId); + taskCB->stackPointer, taskCB->topOfStack); #endif PRINTK("\n"); } diff --git a/components/shell/src/cmds/vfs_shellcmd.c b/components/shell/src/cmds/vfs_shellcmd.c index db2f7153..bfe025ea 100755 --- a/components/shell/src/cmds/vfs_shellcmd.c +++ b/components/shell/src/cmds/vfs_shellcmd.c @@ -276,6 +276,7 @@ int OsShellCmdCat(int argc, const char **argv) if (fd == -1) { ret = -1; + free(fullpath); return ret; }