diff --git a/nshlib/nsh_consolemain.c b/nshlib/nsh_consolemain.c index 8590d0284..23c650d87 100644 --- a/nshlib/nsh_consolemain.c +++ b/nshlib/nsh_consolemain.c @@ -65,6 +65,10 @@ int nsh_consolemain(int argc, FAR char *argv[]) int ret; DEBUGASSERT(pstate != NULL); + if (pstate == NULL) + { + return -ENOMEM; + } /* Execute the session */