)\r
{\r
UINT8 LoopVar;\r
- ASSERT(Script != NULL);\r
- ASSERT(Script->ScriptName != NULL);\r
+\r
+ if (Script == NULL) {\r
+ return;\r
+ }\r
+\r
for (LoopVar = 0 ; LoopVar < Script->Argc ; LoopVar++) {\r
- FreePool(Script->Argv[LoopVar]);\r
+ SHELL_FREE_NON_NULL(Script->Argv[LoopVar]);\r
}\r
if (Script->Argv != NULL) {\r
- FreePool(Script->Argv);\r
+ SHELL_FREE_NON_NULL(Script->Argv);\r
}\r
Script->CurrentCommand = NULL;\r
while (!IsListEmpty (&Script->CommandList)) {\r
if (Script->CurrentCommand != NULL) {\r
RemoveEntryList(&Script->CurrentCommand->Link);\r
if (Script->CurrentCommand->Cl != NULL) {\r
- FreePool(Script->CurrentCommand->Cl);\r
+ SHELL_FREE_NON_NULL(Script->CurrentCommand->Cl);\r
}\r
if (Script->CurrentCommand->Data != NULL) {\r
- FreePool(Script->CurrentCommand->Data);\r
+ SHELL_FREE_NON_NULL(Script->CurrentCommand->Data);\r
}\r
- FreePool(Script->CurrentCommand);\r
+ SHELL_FREE_NON_NULL(Script->CurrentCommand);\r
}\r
}\r
- FreePool(Script->ScriptName);\r
- FreePool(Script);\r
+ SHELL_FREE_NON_NULL(Script->ScriptName);\r
+ SHELL_FREE_NON_NULL(Script);\r
}\r
\r
/**\r
SCRIPT_FILE_LIST *Node;\r
if (Script == NULL) {\r
if (IsListEmpty (&mScriptList.Link)) {\r
- ASSERT(FALSE);\r
return (NULL);\r
}\r
Node = (SCRIPT_FILE_LIST *)GetFirstNode(&mScriptList.Link);\r
FreePool(Node);\r
} else {\r
Node = AllocateZeroPool(sizeof(SCRIPT_FILE_LIST));\r
+ if (Node == NULL) {\r
+ return (NULL);\r
+ }\r
Node->Data = Script;\r
InsertHeadList(&mScriptList.Link, &Node->Link);\r
}\r
//\r
// Find each handle with Simple File System\r
//\r
- HandleList = GetHandleListByPotocol(&gEfiSimpleFileSystemProtocolGuid);\r
+ HandleList = GetHandleListByProtocol(&gEfiSimpleFileSystemProtocolGuid);\r
if (HandleList != NULL) {\r
//\r
// Do a count of the handles\r
//\r
// Find each handle with Block Io\r
//\r
- HandleList = GetHandleListByPotocol(&gEfiBlockIoProtocolGuid);\r
+ HandleList = GetHandleListByProtocol(&gEfiBlockIoProtocolGuid);\r
if (HandleList != NULL) {\r
for (Count = 0 ; HandleList[Count] != NULL ; Count++);\r
\r