Skip to content

Commit 5bb38bb

Browse files
authored
Update msh_file.c
1 parent 7129694 commit 5bb38bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/finsh/msh_file.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ int msh_exec_script(const char *cmd_line, int size)
101101
int length;
102102

103103
line_buf = (char *) rt_malloc(RT_CONSOLEBUF_SIZE);
104-
if (line_buf == RT_NULL) return -RT_ENOMEM;
104+
if (line_buf == RT_NULL)
105+
{
106+
close(fd);
107+
return -RT_ENOMEM;
108+
}
105109

106110
/* read line by line and then exec it */
107111
do

0 commit comments

Comments
 (0)