1) Remove the variable initalization in declaration.

2) Change all gBS->FreePool to use the MdePkg/BaseLib's FreePool.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6662 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2008-11-21 06:59:58 +00:00
parent e38fc27384
commit f4113e1fdb
9 changed files with 105 additions and 103 deletions

View File

@ -301,7 +301,7 @@ ReallocatePool (
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize); CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
} }
gBS->FreePool (OldPool); FreePool (OldPool);
} }
return NewPool; return NewPool;
@ -779,7 +779,7 @@ HiiConfigRoutingExportConfig (
AccessResults = NULL; AccessResults = NULL;
} }
} }
gBS->FreePool (ConfigAccessHandles); FreePool (ConfigAccessHandles);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -79,7 +79,7 @@ GrowStack (
// //
// Free The Old Stack // Free The Old Stack
// //
gBS->FreePool (*Stack); FreePool (*Stack);
} }
// //
@ -650,7 +650,7 @@ IfrToUint (
// BUGBUG: Need handle decimal string // BUGBUG: Need handle decimal string
// //
} }
gBS->FreePool (String); FreePool (String);
} else { } else {
CopyMem (Result, &Value, sizeof (EFI_HII_VALUE)); CopyMem (Result, &Value, sizeof (EFI_HII_VALUE));
} }
@ -949,7 +949,7 @@ IfrMid (
Result->Type = EFI_IFR_TYPE_STRING; Result->Type = EFI_IFR_TYPE_STRING;
Result->Value.string = NewString (SubString, FormSet->HiiHandle); Result->Value.string = NewString (SubString, FormSet->HiiHandle);
gBS->FreePool (String); FreePool (String);
return Status; return Status;
} }
@ -1271,14 +1271,14 @@ CompareHiiValue (
Str2 = GetToken (Value2->Value.string, HiiHandle); Str2 = GetToken (Value2->Value.string, HiiHandle);
if (Str2 == NULL) { if (Str2 == NULL) {
gBS->FreePool (Str1); FreePool (Str1);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
Result = StrCmp (Str1, Str2); Result = StrCmp (Str1, Str2);
gBS->FreePool (Str1); FreePool (Str1);
gBS->FreePool (Str2); FreePool (Str2);
return Result; return Result;
} }
@ -1525,7 +1525,7 @@ EvaluateExpression (
Value->Type = EFI_IFR_TYPE_NUM_SIZE_64; Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;
Value->Value.u64 = StrLen (StrPtr); Value->Value.u64 = StrLen (StrPtr);
gBS->FreePool (StrPtr); FreePool (StrPtr);
break; break;
case EFI_IFR_NOT_OP: case EFI_IFR_NOT_OP:
@ -1589,7 +1589,7 @@ EvaluateExpression (
} else { } else {
Index = (UINT16) Value->Value.u64; Index = (UINT16) Value->Value.u64;
Value->Value.string = Index; Value->Value.string = Index;
gBS->FreePool (StrPtr); FreePool (StrPtr);
} }
break; break;
@ -1629,7 +1629,7 @@ EvaluateExpression (
} else { } else {
Value->Value.b = FALSE; Value->Value.b = FALSE;
} }
gBS->FreePool (StrPtr); FreePool (StrPtr);
Value->Type = EFI_IFR_TYPE_BOOLEAN; Value->Type = EFI_IFR_TYPE_BOOLEAN;
} }
break; break;
@ -1669,7 +1669,7 @@ EvaluateExpression (
mUnicodeCollation->StrUpr (mUnicodeCollation, StrPtr); mUnicodeCollation->StrUpr (mUnicodeCollation, StrPtr);
} }
Value->Value.string = NewString (StrPtr, FormSet->HiiHandle); Value->Value.string = NewString (StrPtr, FormSet->HiiHandle);
gBS->FreePool (StrPtr); FreePool (StrPtr);
break; break;
case EFI_IFR_BITWISE_NOT_OP: case EFI_IFR_BITWISE_NOT_OP:

View File

@ -435,7 +435,7 @@ InitializeRequestElement (
NewStr = AllocateZeroPool (StringSize + CONFIG_REQUEST_STRING_INCREMENTAL * sizeof (CHAR16)); NewStr = AllocateZeroPool (StringSize + CONFIG_REQUEST_STRING_INCREMENTAL * sizeof (CHAR16));
if (Storage->ConfigRequest != NULL) { if (Storage->ConfigRequest != NULL) {
CopyMem (NewStr, Storage->ConfigRequest, StringSize); CopyMem (NewStr, Storage->ConfigRequest, StringSize);
gBS->FreePool (Storage->ConfigRequest); FreePool (Storage->ConfigRequest);
} }
Storage->ConfigRequest = NewStr; Storage->ConfigRequest = NewStr;
Storage->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL; Storage->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL;
@ -476,7 +476,7 @@ DestroyExpression (
// //
// Free this Expression // Free this Expression
// //
gBS->FreePool (Expression); FreePool (Expression);
} }
@ -560,7 +560,7 @@ DestroyStatement (
Default = QUESTION_DEFAULT_FROM_LINK (Link); Default = QUESTION_DEFAULT_FROM_LINK (Link);
RemoveEntryList (&Default->Link); RemoveEntryList (&Default->Link);
gBS->FreePool (Default); FreePool (Default);
} }
// //
@ -571,7 +571,7 @@ DestroyStatement (
Option = QUESTION_OPTION_FROM_LINK (Link); Option = QUESTION_OPTION_FROM_LINK (Link);
RemoveEntryList (&Option->Link); RemoveEntryList (&Option->Link);
gBS->FreePool (Option); FreePool (Option);
} }
// //
@ -645,7 +645,7 @@ DestroyForm (
// //
// Free this Form // Free this Form
// //
gBS->FreePool (Form); FreePool (Form);
} }
@ -692,7 +692,7 @@ DestroyFormSet (
DefaultStore = FORMSET_DEFAULTSTORE_FROM_LINK (Link); DefaultStore = FORMSET_DEFAULTSTORE_FROM_LINK (Link);
RemoveEntryList (&DefaultStore->Link); RemoveEntryList (&DefaultStore->Link);
gBS->FreePool (DefaultStore); FreePool (DefaultStore);
} }
} }

View File

@ -114,8 +114,8 @@ ReadString (
break; break;
case SCAN_ESC: case SCAN_ESC:
gBS->FreePool (TempString); FreePool (TempString);
gBS->FreePool (BufferedString); FreePool (BufferedString);
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
gST->ConOut->EnableCursor (gST->ConOut, CursorVisible); gST->ConOut->EnableCursor (gST->ConOut, CursorVisible);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
@ -129,8 +129,8 @@ ReadString (
case CHAR_CARRIAGE_RETURN: case CHAR_CARRIAGE_RETURN:
if (GetStringWidth (StringPtr) >= ((Minimum + 1) * sizeof (CHAR16))) { if (GetStringWidth (StringPtr) >= ((Minimum + 1) * sizeof (CHAR16))) {
gBS->FreePool (TempString); FreePool (TempString);
gBS->FreePool (BufferedString); FreePool (BufferedString);
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
gST->ConOut->EnableCursor (gST->ConOut, CursorVisible); gST->ConOut->EnableCursor (gST->ConOut, CursorVisible);
return EFI_SUCCESS; return EFI_SUCCESS;
@ -143,8 +143,8 @@ ReadString (
CreateDialog (4, TRUE, 0, NULL, &Key, &NullCharacter, gMiniString, gPressEnter, &NullCharacter); CreateDialog (4, TRUE, 0, NULL, &Key, &NullCharacter, gMiniString, gPressEnter, &NullCharacter);
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
gBS->FreePool (TempString); FreePool (TempString);
gBS->FreePool (BufferedString); FreePool (BufferedString);
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)); gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
gST->ConOut->EnableCursor (gST->ConOut, CursorVisible); gST->ConOut->EnableCursor (gST->ConOut, CursorVisible);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
@ -804,7 +804,7 @@ GetSelectionInputPopUp (
if (StrLen (StringPtr) > PopUpWidth) { if (StrLen (StringPtr) > PopUpWidth) {
PopUpWidth = StrLen (StringPtr); PopUpWidth = StrLen (StringPtr);
} }
gBS->FreePool (StringPtr); FreePool (StringPtr);
if (!OrderedList && CompareHiiValue (&Question->HiiValue, &OneOfOption->Value, NULL) == 0) { if (!OrderedList && CompareHiiValue (&Question->HiiValue, &OneOfOption->Value, NULL) == 0) {
// //
@ -901,7 +901,7 @@ GetSelectionInputPopUp (
TempStringPtr = AllocateZeroPool (sizeof (CHAR16) * (PopUpWidth - 1)); TempStringPtr = AllocateZeroPool (sizeof (CHAR16) * (PopUpWidth - 1));
ASSERT ( TempStringPtr != NULL ); ASSERT ( TempStringPtr != NULL );
CopyMem (TempStringPtr, StringPtr, (sizeof (CHAR16) * (PopUpWidth - 5))); CopyMem (TempStringPtr, StringPtr, (sizeof (CHAR16) * (PopUpWidth - 5)));
gBS->FreePool (StringPtr); FreePool (StringPtr);
StringPtr = TempStringPtr; StringPtr = TempStringPtr;
StrCat (StringPtr, L"..."); StrCat (StringPtr, L"...");
} }
@ -921,7 +921,7 @@ GetSelectionInputPopUp (
} }
Index2++; Index2++;
gBS->FreePool (StringPtr); FreePool (StringPtr);
} }
Character = BOXDRAW_UP_RIGHT; Character = BOXDRAW_UP_RIGHT;
@ -1067,7 +1067,7 @@ TheKey:
} }
} }
gBS->FreePool (HiiValueArray); FreePool (HiiValueArray);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
default: default:
@ -1100,7 +1100,7 @@ TheKey:
} }
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute); gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
gBS->FreePool (HiiValueArray); FreePool (HiiValueArray);
Status = ValidateQuestion (Selection->FormSet, Selection->Form, Question, EFI_HII_EXPRESSION_INCONSISTENT_IF); Status = ValidateQuestion (Selection->FormSet, Selection->Form, Question, EFI_HII_EXPRESSION_INCONSISTENT_IF);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {

View File

@ -66,7 +66,7 @@ ClearLines (
gST->ConOut->SetCursorPosition (gST->ConOut, LeftColumn, TopRow); gST->ConOut->SetCursorPosition (gST->ConOut, LeftColumn, TopRow);
gBS->FreePool (Buffer); FreePool (Buffer);
return ; return ;
} }
@ -269,7 +269,7 @@ DisplayPageFrame (
break; break;
} }
gBS->FreePool (StrFrontPageBanner); FreePool (StrFrontPageBanner);
} }
} }
} }
@ -350,7 +350,7 @@ DisplayPageFrame (
} }
} }
gBS->FreePool (Buffer); FreePool (Buffer);
} }
@ -486,7 +486,7 @@ DisplayForm (
// //
// Remove Buffer allocated for StringPtr after it has been used. // Remove Buffer allocated for StringPtr after it has been used.
// //
gBS->FreePool (StringPtr); FreePool (StringPtr);
// //
// Evaluate all the Expressions in this Form // Evaluate all the Expressions in this Form
@ -521,7 +521,7 @@ DisplayForm (
NumberOfLines++; NumberOfLines++;
} }
gBS->FreePool (OutputString); FreePool (OutputString);
} }
// //

View File

@ -147,8 +147,8 @@ PrintInternal (
Out->OutputString (Out, &BackupBuffer[PreviousIndex]); Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
Count += StrLen (&BackupBuffer[PreviousIndex]); Count += StrLen (&BackupBuffer[PreviousIndex]);
gBS->FreePool (Buffer); FreePool (Buffer);
gBS->FreePool (BackupBuffer); FreePool (BackupBuffer);
return Count; return Count;
} }

View File

@ -383,7 +383,7 @@ ProcessOptions (
Status = SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE); Status = SetQuestionValue (Selection->FormSet, Selection->Form, Question, TRUE);
UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE); UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
gBS->FreePool (*OptionString); FreePool (*OptionString);
*OptionString = NULL; *OptionString = NULL;
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -407,7 +407,7 @@ ProcessOptions (
Character[0] = CHAR_CARRIAGE_RETURN; Character[0] = CHAR_CARRIAGE_RETURN;
NewStrCat (OptionString[0], Character); NewStrCat (OptionString[0], Character);
gBS->FreePool (StringPtr); FreePool (StringPtr);
} }
} }
} }
@ -450,7 +450,7 @@ ProcessOptions (
Link = GetNextNode (&Question->OptionListHead, Link); Link = GetNextNode (&Question->OptionListHead, Link);
} }
gBS->FreePool (*OptionString); FreePool (*OptionString);
*OptionString = NULL; *OptionString = NULL;
} }
@ -495,7 +495,7 @@ ProcessOptions (
Character[0] = RIGHT_ONEOF_DELIMITER; Character[0] = RIGHT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character); NewStrCat (OptionString[0], Character);
gBS->FreePool (StringPtr); FreePool (StringPtr);
} }
} }
break; break;
@ -521,7 +521,7 @@ ProcessOptions (
// Inconsistent check fail, restore Question Value // Inconsistent check fail, restore Question Value
// //
QuestionValue->Value.b = (BOOLEAN) (QuestionValue->Value.b ? FALSE : TRUE); QuestionValue->Value.b = (BOOLEAN) (QuestionValue->Value.b ? FALSE : TRUE);
gBS->FreePool (*OptionString); FreePool (*OptionString);
*OptionString = NULL; *OptionString = NULL;
return Status; return Status;
} }
@ -641,7 +641,7 @@ ProcessOptions (
UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE); UpdateStatusBar (NV_UPDATE_REQUIRED, Question->QuestionFlags, TRUE);
} }
gBS->FreePool (StringPtr); FreePool (StringPtr);
} else { } else {
*OptionString = AllocateZeroPool (BufferSize); *OptionString = AllocateZeroPool (BufferSize);
ASSERT (*OptionString); ASSERT (*OptionString);
@ -675,7 +675,7 @@ ProcessOptions (
// //
// Callback request to terminate password input // Callback request to terminate password input
// //
gBS->FreePool (StringPtr); FreePool (StringPtr);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -685,7 +685,7 @@ ProcessOptions (
// //
Status = ReadString (MenuOption, gPromptForPassword, StringPtr); Status = ReadString (MenuOption, gPromptForPassword, StringPtr);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (StringPtr); FreePool (StringPtr);
return Status; return Status;
} }
@ -703,7 +703,7 @@ ProcessOptions (
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
} }
gBS->FreePool (StringPtr); FreePool (StringPtr);
return Status; return Status;
} }
} }
@ -717,7 +717,7 @@ ProcessOptions (
// //
Status = ReadString (MenuOption, gPromptForPassword, StringPtr); Status = ReadString (MenuOption, gPromptForPassword, StringPtr);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (StringPtr); FreePool (StringPtr);
return Status; return Status;
} }
@ -730,12 +730,12 @@ ProcessOptions (
// //
PasswordInvalid (); PasswordInvalid ();
gBS->FreePool (StringPtr); FreePool (StringPtr);
gBS->FreePool (TempString); FreePool (TempString);
return Status; return Status;
} }
gBS->FreePool (TempString); FreePool (TempString);
} }
} }
@ -752,7 +752,7 @@ ProcessOptions (
PasswordCallback (Selection, MenuOption, NULL); PasswordCallback (Selection, MenuOption, NULL);
} }
gBS->FreePool (StringPtr); FreePool (StringPtr);
return Status; return Status;
} }
@ -770,8 +770,8 @@ ProcessOptions (
PasswordCallback (Selection, MenuOption, NULL); PasswordCallback (Selection, MenuOption, NULL);
} }
gBS->FreePool (StringPtr); FreePool (StringPtr);
gBS->FreePool (TempString); FreePool (TempString);
return Status; return Status;
} }
@ -804,8 +804,8 @@ ProcessOptions (
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
} }
gBS->FreePool (TempString); FreePool (TempString);
gBS->FreePool (StringPtr); FreePool (StringPtr);
} }
break; break;
@ -833,7 +833,7 @@ ProcessHelpString (
IN UINTN RowCount IN UINTN RowCount
) )
{ {
UINTN BlockWidth = (UINTN) gHelpBlockWidth - 1; UINTN BlockWidth;
UINTN AllocateSize; UINTN AllocateSize;
// //
// [PrevCurrIndex, CurrIndex) forms a range of a screen-line // [PrevCurrIndex, CurrIndex) forms a range of a screen-line
@ -866,6 +866,8 @@ ProcessHelpString (
UINTN *IndexArray; UINTN *IndexArray;
UINTN *OldIndexArray; UINTN *OldIndexArray;
BlockWidth = (UINTN) gHelpBlockWidth - 1;
// //
// every three elements of IndexArray form a screen-line of string:[ IndexArray[i*3], IndexArray[i*3+1] ) // every three elements of IndexArray form a screen-line of string:[ IndexArray[i*3], IndexArray[i*3+1] )
// IndexArray[i*3+2] stores the initial glyph width of single character. to save this is because we want // IndexArray[i*3+2] stores the initial glyph width of single character. to save this is because we want
@ -877,7 +879,7 @@ ProcessHelpString (
IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3); IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3);
if (*FormattedString != NULL) { if (*FormattedString != NULL) {
gBS->FreePool (*FormattedString); FreePool (*FormattedString);
*FormattedString = NULL; *FormattedString = NULL;
} }
@ -891,7 +893,7 @@ ProcessHelpString (
OldIndexArray = IndexArray; OldIndexArray = IndexArray;
IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3); IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3);
CopyMem (IndexArray, OldIndexArray, LineCount * sizeof (UINTN) * 3); CopyMem (IndexArray, OldIndexArray, LineCount * sizeof (UINTN) * 3);
gBS->FreePool (OldIndexArray); FreePool (OldIndexArray);
} }
switch (StringPtr[CurrIndex]) { switch (StringPtr[CurrIndex]) {
@ -1020,5 +1022,5 @@ ProcessHelpString (
); );
} }
gBS->FreePool (IndexArray); FreePool (IndexArray);
} }

View File

@ -333,7 +333,7 @@ SendForm (
} while (Selection->Action == UI_ACTION_REFRESH_FORMSET); } while (Selection->Action == UI_ACTION_REFRESH_FORMSET);
gBS->FreePool (Selection); FreePool (Selection);
} }
if (ActionRequest != NULL) { if (ActionRequest != NULL) {
@ -482,14 +482,14 @@ BrowserCallback (
if (*ResultsDataSize < BufferSize) { if (*ResultsDataSize < BufferSize) {
*ResultsDataSize = BufferSize; *ResultsDataSize = BufferSize;
gBS->FreePool (ConfigResp); FreePool (ConfigResp);
return EFI_BUFFER_TOO_SMALL; return EFI_BUFFER_TOO_SMALL;
} }
*ResultsDataSize = BufferSize; *ResultsDataSize = BufferSize;
CopyMem (ResultsData, StrPtr, BufferSize); CopyMem (ResultsData, StrPtr, BufferSize);
gBS->FreePool (ConfigResp); FreePool (ConfigResp);
} else { } else {
// //
// Prepare <ConfigResp> // Prepare <ConfigResp>
@ -701,7 +701,7 @@ GetToken (
Status = HiiLibGetString (HiiHandle, Token, String, &BufferLength); Status = HiiLibGetString (HiiHandle, Token, String, &BufferLength);
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
gBS->FreePool (String); FreePool (String);
String = AllocateZeroPool (BufferLength); String = AllocateZeroPool (BufferLength);
ASSERT (String != NULL); ASSERT (String != NULL);
@ -762,7 +762,7 @@ NewStringCat (
StrCpy (NewString, *Dest); StrCpy (NewString, *Dest);
StrCat (NewString, Src); StrCat (NewString, Src);
gBS->FreePool (*Dest); FreePool (*Dest);
*Dest = NewString; *Dest = NewString;
} }
@ -1188,7 +1188,7 @@ GetQuestionValue (
Status = HexStringToBuf (Dst, &StorageWidth, Value, NULL); Status = HexStringToBuf (Dst, &StorageWidth, Value, NULL);
} }
gBS->FreePool (Value); FreePool (Value);
} }
} else { } else {
// //
@ -1241,7 +1241,7 @@ GetQuestionValue (
Value = Value + 6; Value = Value + 6;
} }
if (*Value != '=') { if (*Value != '=') {
gBS->FreePool (Result); FreePool (Result);
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
// //
@ -1267,7 +1267,7 @@ GetQuestionValue (
} else { } else {
Status = HexStringToBuf (Dst, &StorageWidth, Value, NULL); Status = HexStringToBuf (Dst, &StorageWidth, Value, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (Result); FreePool (Result);
return Status; return Status;
} }
} }
@ -1280,7 +1280,7 @@ GetQuestionValue (
} else { } else {
SetValueByName (Storage, Question->VariableName, Value); SetValueByName (Storage, Question->VariableName, Value);
} }
gBS->FreePool (Result); FreePool (Result);
} }
return Status; return Status;
@ -1450,7 +1450,7 @@ SetQuestionValue (
} }
Status = SetValueByName (Storage, Question->VariableName, Value); Status = SetValueByName (Storage, Question->VariableName, Value);
gBS->FreePool (Value); FreePool (Value);
} }
if (!Cached) { if (!Cached) {
@ -1505,11 +1505,11 @@ SetQuestionValue (
&Progress &Progress
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (ConfigResp); FreePool (ConfigResp);
return Status; return Status;
} }
} }
gBS->FreePool (ConfigResp); FreePool (ConfigResp);
// //
// Synchronize shadow Buffer // Synchronize shadow Buffer
@ -1577,7 +1577,7 @@ ValidateQuestion (
do { do {
CreateDialog (4, TRUE, 0, NULL, &Key, gEmptyString, PopUp, gPressEnter, gEmptyString); CreateDialog (4, TRUE, 0, NULL, &Key, gEmptyString, PopUp, gPressEnter, gEmptyString);
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN); } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
gBS->FreePool (PopUp); FreePool (PopUp);
} }
return EFI_NOT_READY; return EFI_NOT_READY;
@ -1692,11 +1692,11 @@ SubmitForm (
&Progress &Progress
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (ConfigResp); FreePool (ConfigResp);
return Status; return Status;
} }
} }
gBS->FreePool (ConfigResp); FreePool (ConfigResp);
// //
// Config success, update storage shadow Buffer // Config success, update storage shadow Buffer
@ -2034,7 +2034,7 @@ LoadStorage (
} }
Status = ConfigRespToStorage (Storage, Result); Status = ConfigRespToStorage (Storage, Result);
gBS->FreePool (Result); FreePool (Result);
return Status; return Status;
} }
@ -2211,7 +2211,7 @@ GetIfrBinaryData (
// //
// Form package not found in this Package List // Form package not found in this Package List
// //
gBS->FreePool (HiiPackageList); FreePool (HiiPackageList);
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -2230,7 +2230,7 @@ GetIfrBinaryData (
*BinaryLength = PackageHeader.Length - Offset2; *BinaryLength = PackageHeader.Length - Offset2;
*BinaryData = AllocateCopyPool (*BinaryLength, OpCodeData); *BinaryData = AllocateCopyPool (*BinaryLength, OpCodeData);
gBS->FreePool (HiiPackageList); FreePool (HiiPackageList);
if (*BinaryData == NULL) { if (*BinaryData == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;

View File

@ -190,7 +190,7 @@ UiRemoveMenuListEntry (
Selection->FormId = UiMenuList->FormId; Selection->FormId = UiMenuList->FormId;
Selection->QuestionId = UiMenuList->QuestionId; Selection->QuestionId = UiMenuList->QuestionId;
RemoveEntryList (&UiMenuList->MenuLink); RemoveEntryList (&UiMenuList->MenuLink);
gBS->FreePool (UiMenuList); FreePool (UiMenuList);
} }
} }
@ -209,7 +209,7 @@ UiFreeMenuList (
while (!IsListEmpty (&gMenuList)) { while (!IsListEmpty (&gMenuList)) {
UiMenuList = CR (gMenuList.ForwardLink, UI_MENU_LIST, MenuLink, UI_MENU_LIST_SIGNATURE); UiMenuList = CR (gMenuList.ForwardLink, UI_MENU_LIST, MenuLink, UI_MENU_LIST_SIGNATURE);
RemoveEntryList (&UiMenuList->MenuLink); RemoveEntryList (&UiMenuList->MenuLink);
gBS->FreePool (UiMenuList); FreePool (UiMenuList);
} }
} }
@ -262,9 +262,9 @@ UiFreeMenu (
// Data format : [01/02/2004] [11:22:33] // Data format : [01/02/2004] [11:22:33]
// Line number : 0 0 1 0 0 1 // Line number : 0 0 1 0 0 1
// //
gBS->FreePool (MenuOption->Description); FreePool (MenuOption->Description);
} }
gBS->FreePool (MenuOption); FreePool (MenuOption);
} }
} }
@ -282,7 +282,7 @@ UiFreeRefreshList (
while (gMenuRefreshHead != NULL) { while (gMenuRefreshHead != NULL) {
OldMenuRefreshEntry = gMenuRefreshHead->Next; OldMenuRefreshEntry = gMenuRefreshHead->Next;
gBS->FreePool (gMenuRefreshHead); FreePool (gMenuRefreshHead);
gMenuRefreshHead = OldMenuRefreshEntry; gMenuRefreshHead = OldMenuRefreshEntry;
} }
@ -341,7 +341,7 @@ RefreshForm (
; ;
PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]); PrintStringAt (MenuRefreshEntry->CurrentColumn, MenuRefreshEntry->CurrentRow, &OptionString[Index]);
gBS->FreePool (OptionString); FreePool (OptionString);
} }
// //
@ -728,8 +728,8 @@ CreateDialog (
case CHAR_NULL: case CHAR_NULL:
switch (Key.ScanCode) { switch (Key.ScanCode) {
case SCAN_ESC: case SCAN_ESC:
gBS->FreePool (TempString); FreePool (TempString);
gBS->FreePool (BufferedString); FreePool (BufferedString);
gST->ConOut->SetAttribute (gST->ConOut, CurrentAttribute); gST->ConOut->SetAttribute (gST->ConOut, CurrentAttribute);
gST->ConOut->EnableCursor (gST->ConOut, TRUE); gST->ConOut->EnableCursor (gST->ConOut, TRUE);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
@ -742,8 +742,8 @@ CreateDialog (
case CHAR_CARRIAGE_RETURN: case CHAR_CARRIAGE_RETURN:
SelectionComplete = TRUE; SelectionComplete = TRUE;
gBS->FreePool (TempString); FreePool (TempString);
gBS->FreePool (BufferedString); FreePool (BufferedString);
gST->ConOut->SetAttribute (gST->ConOut, CurrentAttribute); gST->ConOut->SetAttribute (gST->ConOut, CurrentAttribute);
gST->ConOut->EnableCursor (gST->ConOut, TRUE); gST->ConOut->EnableCursor (gST->ConOut, TRUE);
return EFI_SUCCESS; return EFI_SUCCESS;
@ -1017,8 +1017,8 @@ UpdateStatusBar (
break; break;
} }
gBS->FreePool (InputErrorMessage); FreePool (InputErrorMessage);
gBS->FreePool (NvUpdateMessage); FreePool (NvUpdateMessage);
return ; return ;
} }
@ -1050,7 +1050,7 @@ GetWidth (
if ((Statement->Operand == EFI_IFR_TEXT_OP) && (Statement->TextTwo != 0)) { if ((Statement->Operand == EFI_IFR_TEXT_OP) && (Statement->TextTwo != 0)) {
String = GetToken (Statement->TextTwo, Handle); String = GetToken (Statement->TextTwo, Handle);
Size = StrLen (String); Size = StrLen (String);
gBS->FreePool (String); FreePool (String);
} }
if ((Statement->Operand == EFI_IFR_SUBTITLE_OP) || if ((Statement->Operand == EFI_IFR_SUBTITLE_OP) ||
@ -1234,7 +1234,7 @@ UpdateOptionSkipLines (
} }
} }
gBS->FreePool (OutputString); FreePool (OutputString);
if (SkipValue != 0) { if (SkipValue != 0) {
SkipValue--; SkipValue--;
} }
@ -1641,7 +1641,7 @@ UiDisplayMenu (
} }
} }
gBS->FreePool (OutputString); FreePool (OutputString);
if (Temp != 0) { if (Temp != 0) {
Temp--; Temp--;
} }
@ -1746,7 +1746,7 @@ UiDisplayMenu (
} }
} }
gBS->FreePool (OutputString); FreePool (OutputString);
if (Temp2 != 0) { if (Temp2 != 0) {
Temp2--; Temp2--;
} }
@ -1755,7 +1755,7 @@ UiDisplayMenu (
Temp2 = 0; Temp2 = 0;
Row = OriginalRow; Row = OriginalRow;
gBS->FreePool (OptionString); FreePool (OptionString);
} }
// //
// If this is a text op with secondary text information // If this is a text op with secondary text information
@ -1789,14 +1789,14 @@ UiDisplayMenu (
} }
} }
gBS->FreePool (OutputString); FreePool (OutputString);
if (Temp2 != 0) { if (Temp2 != 0) {
Temp2--; Temp2--;
} }
} }
Row = OriginalRow; Row = OriginalRow;
gBS->FreePool (StringPtr); FreePool (StringPtr);
} }
// //
@ -1951,12 +1951,12 @@ UiDisplayMenu (
MenuOption->Row++; MenuOption->Row++;
} }
gBS->FreePool (OutputString); FreePool (OutputString);
} }
MenuOption->Row = OriginalRow; MenuOption->Row = OriginalRow;
gBS->FreePool (OptionString); FreePool (OptionString);
} else { } else {
if (NewLine) { if (NewLine) {
if (MenuOption->GrayOut) { if (MenuOption->GrayOut) {
@ -1979,7 +1979,7 @@ UiDisplayMenu (
MenuOption->Row++; MenuOption->Row++;
} }
gBS->FreePool (OutputString); FreePool (OutputString);
} }
MenuOption->Row = OriginalRow; MenuOption->Row = OriginalRow;
@ -2057,12 +2057,12 @@ UiDisplayMenu (
MenuOption->Row++; MenuOption->Row++;
} }
gBS->FreePool (OutputString); FreePool (OutputString);
} }
MenuOption->Row = OriginalRow; MenuOption->Row = OriginalRow;
gBS->FreePool (OptionString); FreePool (OptionString);
} else { } else {
if (NewLine) { if (NewLine) {
OriginalRow = MenuOption->Row; OriginalRow = MenuOption->Row;
@ -2080,7 +2080,7 @@ UiDisplayMenu (
MenuOption->Row++; MenuOption->Row++;
} }
gBS->FreePool (OutputString); FreePool (OutputString);
} }
MenuOption->Row = OriginalRow; MenuOption->Row = OriginalRow;
@ -2372,8 +2372,8 @@ UiDisplayMenu (
break; break;
} }
gBS->FreePool (StringPtr); FreePool (StringPtr);
gBS->FreePool (DevicePath); FreePool (DevicePath);
CopyMem (&Selection->FormSetGuid, &Statement->RefFormSetId, sizeof (EFI_GUID)); CopyMem (&Selection->FormSetGuid, &Statement->RefFormSetId, sizeof (EFI_GUID));
Selection->FormId = Statement->RefFormId; Selection->FormId = Statement->RefFormId;