msh: check path is non-null in msh_auto_complete_path

This commit is contained in:
Grissiom 2014-10-14 16:07:19 +08:00
parent 8615e2c8e5
commit 23cc390474
1 changed files with 3 additions and 0 deletions

View File

@ -358,6 +358,9 @@ void msh_auto_complete_path(char *path)
struct dirent *dirent = RT_NULL;
char *full_path, *ptr, *index;
if (!path)
return;
full_path = (char*)rt_malloc(256);
if (full_path == RT_NULL) return; /* out of memory */