mirror of https://github.com/acidanthera/audk.git
MdeModulePkg HiiDataBase: Fix the potential NULL pointer access
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
7a3ed289f2
commit
a8e786e8b2
|
@ -721,9 +721,14 @@ FindQuestionDefaultSetting (
|
|||
VariableStorage = NULL;
|
||||
}
|
||||
Entry = AllocatePool (sizeof (VARSTORAGE_DEFAULT_DATA));
|
||||
Entry->DefaultId = DefaultId;
|
||||
Entry->VariableStorage = VariableStorage;
|
||||
InsertTailList (&gVarStorageList, &Entry->Entry);
|
||||
if (Entry != NULL) {
|
||||
Entry->DefaultId = DefaultId;
|
||||
Entry->VariableStorage = VariableStorage;
|
||||
InsertTailList (&gVarStorageList, &Entry->Entry);
|
||||
} else if (VariableStorage != NULL) {
|
||||
FreePool (VariableStorage);
|
||||
VariableStorage = NULL;
|
||||
}
|
||||
}
|
||||
//
|
||||
// The matched variable storage is not found.
|
||||
|
|
Loading…
Reference in New Issue