BaseTools/VfrCompile: Resolve uninit class variables in constructor

The commit initializes those possibly uninitialized class variables in
class constructors.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Hao Wu
2017-12-18 10:11:57 +08:00
parent d837f33ab0
commit b748e35c2b
3 changed files with 10 additions and 0 deletions

View File

@ -958,6 +958,7 @@ CVfrVarDataTypeDB::CVfrVarDataTypeDB (
mPackAlign = DEFAULT_PACK_ALIGN;
mPackStack = NULL;
mFirstNewDataTypeName = NULL;
mCurrDataType = NULL;
InternalTypesListInit ();
}
@ -1605,6 +1606,7 @@ SVfrVarStorageNode::SVfrVarStorageNode (
IN EFI_VARSTORE_ID VarStoreId
)
{
memset (&mGuid, 0, sizeof (EFI_GUID));
if (StoreName != NULL) {
mVarStoreName = new CHAR8[strlen(StoreName) + 1];
strcpy (mVarStoreName, StoreName);
@ -1616,6 +1618,7 @@ SVfrVarStorageNode::SVfrVarStorageNode (
mVarStoreType = EFI_VFR_VARSTORE_NAME;
mStorageInfo.mNameSpace.mNameTable = new EFI_VARSTORE_ID[DEFAULT_NAME_TABLE_ITEMS];
mStorageInfo.mNameSpace.mTableSize = 0;
mAssignedFlag = FALSE;
}
SVfrVarStorageNode::~SVfrVarStorageNode (