diff options
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Setup.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index f728d53910..29b606fdef 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -724,7 +724,9 @@ NewStringCpy ( IN CHAR16 *Src
)
{
- SafeFreePool (*Dest);
+ if (*Dest != NULL) {
+ FreePool (*Dest);
+ }
*Dest = AllocateCopyPool (StrSize (Src), Src);
ASSERT (*Dest != NULL);
}
@@ -865,7 +867,9 @@ SetValueByName ( Node = NAME_VALUE_NODE_FROM_LINK (Link);
if (StrCmp (Name, Node->Name) == 0) {
- SafeFreePool (Node->EditValue);
+ if (Node->EditValue != NULL) {
+ FreePool (Node->EditValue);
+ }
Node->EditValue = AllocateCopyPool (StrSize (Value), Value);
ASSERT (Node->EditValue != NULL);
return EFI_SUCCESS;
|