/* 1) frees all pointers (non-NULL) 2) Closes the SHELL_FILE_HANDLE */
VOID InternalFreeShellFileInfoNode(IN EFI_SHELL_FILE_INFO *FileListNode)
/* 1) frees all pointers (non-NULL) 2) Closes the SHELL_FILE_HANDLE */
VOID InternalFreeShellFileInfoNode(IN EFI_SHELL_FILE_INFO *FileListNode)
{
  if (FileListNode->Info != NULL) {
    FreePool ((VOID *)FileListNode->Info);
  }
  if (FileListNode->FileName != NULL) {
    FreePool ((VOID *)FileListNode->FileName);
  }
  if (FileListNode->FullName != NULL) {
    FreePool ((VOID *)FileListNode->FullName);
  }
  if (FileListNode->Handle != NULL) {
    ShellInfoObject.NewEfiShellProtocol->CloseFile (FileListNode->Handle);
  }
  FreePool (FileListNode);
}