mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
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;
|
VariableStorage = NULL;
|
||||||
}
|
}
|
||||||
Entry = AllocatePool (sizeof (VARSTORAGE_DEFAULT_DATA));
|
Entry = AllocatePool (sizeof (VARSTORAGE_DEFAULT_DATA));
|
||||||
|
if (Entry != NULL) {
|
||||||
Entry->DefaultId = DefaultId;
|
Entry->DefaultId = DefaultId;
|
||||||
Entry->VariableStorage = VariableStorage;
|
Entry->VariableStorage = VariableStorage;
|
||||||
InsertTailList (&gVarStorageList, &Entry->Entry);
|
InsertTailList (&gVarStorageList, &Entry->Entry);
|
||||||
|
} else if (VariableStorage != NULL) {
|
||||||
|
FreePool (VariableStorage);
|
||||||
|
VariableStorage = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// The matched variable storage is not found.
|
// The matched variable storage is not found.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user