diff options
Diffstat (limited to 'Library/UefiShellUfmCommandLib')
-rw-r--r-- | Library/UefiShellUfmCommandLib/dir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/UefiShellUfmCommandLib/dir.c b/Library/UefiShellUfmCommandLib/dir.c index 782334d..2d50173 100644 --- a/Library/UefiShellUfmCommandLib/dir.c +++ b/Library/UefiShellUfmCommandLib/dir.c @@ -32,10 +32,12 @@ struct dir_list *dirl_alloc(CHAR16 *search_path, CONST UINT64 attr) // I have stolen code below in the source code of InternalFreeShellFileInfoNode(): RemoveEntryList(&node->Link); - FreePool((VOID*)node->Info); + if(node->Info != NULL) + FreePool((VOID*)node->Info); FreePool((VOID*)node->FileName); FreePool((VOID*)node->FullName); - gEfiShellProtocol->CloseFile(node->Handle); + if(node->Handle != NULL) + gEfiShellProtocol->CloseFile(node->Handle); FreePool(node); node = tmp; continue; |