mirror of https://github.com/acidanthera/audk.git
BaseTools/VfrCompile:Fix memory leak issues
Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
55f67014d7
commit
2aa9a9f03e
|
@ -4105,6 +4105,7 @@ vfrStatementExpression [UINT32 RootLevel, UINT32 ExpOpCount = 0] :
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($RootLevel == 0) {
|
if ($RootLevel == 0) {
|
||||||
|
_CLEAR_SAVED_OPHDR ();
|
||||||
mCIfrOpHdrIndex --;
|
mCIfrOpHdrIndex --;
|
||||||
}
|
}
|
||||||
>>
|
>>
|
||||||
|
@ -4389,6 +4390,12 @@ vareqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
<< IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_THAN); >>
|
<< IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_THAN); >>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
<<
|
||||||
|
if (VarIdStr != NULL) {
|
||||||
|
delete[] VarIdStr;
|
||||||
|
VarIdStr = NULL;
|
||||||
|
}
|
||||||
|
>>
|
||||||
;
|
;
|
||||||
|
|
||||||
ideqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
ideqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
|
@ -4442,6 +4449,12 @@ ideqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
<< IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_THAN); >>
|
<< IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_THAN); >>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
<<
|
||||||
|
if (VarIdStr != NULL) {
|
||||||
|
delete[] VarIdStr;
|
||||||
|
VarIdStr = NULL;
|
||||||
|
}
|
||||||
|
>>
|
||||||
;
|
;
|
||||||
|
|
||||||
ideqidExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
ideqidExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
|
@ -4494,6 +4507,16 @@ ideqidExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
<< IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], GREATER_THAN); >>
|
<< IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], GREATER_THAN); >>
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
<<
|
||||||
|
if (VarIdStr[0] != NULL) {
|
||||||
|
delete[] VarIdStr[0];
|
||||||
|
VarIdStr[0] = NULL;
|
||||||
|
}
|
||||||
|
if (VarIdStr[1] != NULL) {
|
||||||
|
delete[] VarIdStr[1];
|
||||||
|
VarIdStr[1] = NULL;
|
||||||
|
}
|
||||||
|
>>
|
||||||
;
|
;
|
||||||
|
|
||||||
ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
|
@ -4533,6 +4556,10 @@ ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
||||||
}
|
}
|
||||||
$ExpOpCount++;
|
$ExpOpCount++;
|
||||||
}
|
}
|
||||||
|
if (VarIdStr != NULL) {
|
||||||
|
delete[] VarIdStr;
|
||||||
|
VarIdStr = NULL;
|
||||||
|
}
|
||||||
>>
|
>>
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -5057,7 +5084,10 @@ EfiVfrParser::_CLEAR_SAVED_OPHDR (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (mCIfrOpHdr[mCIfrOpHdrIndex] != NULL) {
|
||||||
|
delete mCIfrOpHdr[mCIfrOpHdrIndex];
|
||||||
mCIfrOpHdr[mCIfrOpHdrIndex] = NULL;
|
mCIfrOpHdr[mCIfrOpHdrIndex] = NULL;
|
||||||
|
}
|
||||||
mCIfrOpHdrLineNo[mCIfrOpHdrIndex] = 0;
|
mCIfrOpHdrLineNo[mCIfrOpHdrIndex] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue