diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 3bd120e699..f7d8b053ae 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -438,8 +438,9 @@ CreateStorage ( EFI_GUID *StorageGuid; CHAR8 *StorageName; - UnicodeString = NULL; - StorageName = NULL; + UnicodeString = NULL; + StorageName = NULL; + BrowserStorage = NULL; // MU_CHANGE - Initialize variable that might not be updated due to error checking switch (StorageType) { case EFI_HII_VARSTORE_BUFFER: StorageGuid = (EFI_GUID *)(CHAR8 *)&((EFI_IFR_VARSTORE *)OpCodeData)->Guid; @@ -534,11 +535,11 @@ CreateStorage ( FreePool (BrowserStorage); } - if (Storage->ConfigRequest != NULL) { - FreePool (Storage->ConfigRequest); - } - if (Storage != NULL) { + if (Storage->ConfigRequest != NULL) { + FreePool (Storage->ConfigRequest); + } + FreePool (Storage); }