summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-30 08:00:56 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-30 08:00:56 +0000
commit7001eaf8e5c94dc03446d6edba3d523060b6a346 (patch)
treedfc8deeb1ef93f691d79a629f0755f35a5ac846a /EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
parent676df92c2c0c5bdeb0f8e27349f5dd467928ce09 (diff)
downloadedk2-platforms-7001eaf8e5c94dc03446d6edba3d523060b6a346.tar.xz
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its implementation only check if a pointer is NULL. If a garbage pointer is passed in, the gBS->FreePool will still ASSERT in debug build and return error code.
It is recommended that module writer should keep track how a pointer is allocated and free it after use. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6307 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c')
-rw-r--r--EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
index 845a9f72e0..c6b30cb85a 100644
--- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
+++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/HiiDatabase.c
@@ -408,7 +408,9 @@ Returns:
Done:
FreePool (LangCodes3066);
- SafeFreePool (LangCodes639);
+ if (LangCodes639 != NULL) {
+ FreePool (LangCodes639);
+ }
return Status;
}
@@ -491,11 +493,18 @@ Returns:
*LanguageString = AsciiStrToUnicodeStr (SecLangCodes639, UnicodeSecLangCodes639);
Done:
-
- SafeFreePool (PrimaryLang639);
- SafeFreePool (SecLangCodes639);
- SafeFreePool (SecLangCodes3066);
- SafeFreePool (UnicodeSecLangCodes639);
+ if (PrimaryLang639 != NULL) {
+ FreePool (PrimaryLang639);
+ }
+ if (SecLangCodes639 != NULL) {
+ FreePool (SecLangCodes639);
+ }
+ if (SecLangCodes3066 != NULL) {
+ FreePool (SecLangCodes3066);
+ }
+ if (UnicodeSecLangCodes639 != NULL) {
+ FreePool (UnicodeSecLangCodes639);
+ }
return Status;
}