fixes for NULL verification.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11125 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2010-12-06 18:10:34 +00:00
parent eca37a3101
commit c154b99708
3 changed files with 109 additions and 105 deletions

View File

@ -183,7 +183,7 @@ GetEnvironmentVariableList(
Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val);
}
}
if (!EFI_ERROR(Status)) {
if (!EFI_ERROR(Status) && VarList != NULL) {
VarList->Key = AllocatePool(StrSize(VariableName));
if (VarList->Key == NULL) {
SHELL_FREE_NON_NULL(VarList->Val);

View File

@ -907,6 +907,7 @@ InternalOpenFileDevicePath(
if (!EFI_ERROR(Status)) {
Handle1 = ConvertShellHandleToEfiFileProtocol(ShellHandle);
if (Handle1 != NULL) {
//
// chop off the begining part before the file system part...
//
@ -999,6 +1000,7 @@ InternalOpenFileDevicePath(
} // for loop
}
}
}
SHELL_FREE_NON_NULL(AlignedNode);
if (EFI_ERROR(Status)) {
if (Handle1 != NULL) {
@ -2001,7 +2003,7 @@ ShellSearchHandle(
ShellInfoNode->FullName = NewFullName;
}
}
if (Directory && !EFI_ERROR(Status)){
if (Directory && !EFI_ERROR(Status) && ShellInfoNode->FullName != NULL && ShellInfoNode->FileName != NULL){
//
// should be a directory
//
@ -2015,7 +2017,6 @@ ShellSearchHandle(
//
//
//
ASSERT_EFI_ERROR(Status);
if (EFI_ERROR(Status)) {
break;
}

View File

@ -679,6 +679,7 @@ PerformMappingDelete(
return (Status);
}
if (HandleBuffer != NULL) {
//
// Get the map name(s) for each one.
//
@ -690,7 +691,7 @@ PerformMappingDelete(
Deleted = TRUE;
}
}
}
//
// Look up all BlockIo in the platform
//
@ -718,6 +719,7 @@ PerformMappingDelete(
return (Status);
}
if (HandleBuffer != NULL) {
//
// Get the map name(s) for each one.
//
@ -741,7 +743,8 @@ PerformMappingDelete(
Deleted = TRUE;
}
}
FreePool(HandleBuffer);
}
SHELL_FREE_NON_NULL(HandleBuffer);
if (!Deleted) {
return (EFI_NOT_FOUND);
}