mirror of
https://git.proxmox.com/git/mirror_edk2
synced 2026-01-08 19:52:02 +00:00
https://bugzilla.tianocore.org/show_bug.cgi?id=667 reported there is double free pages on LoadImage failure path. CoreLoadPeImage() ... return EFI_SUCCESS; Done: // // Free memory. // if (DstBufAlocated) { CoreFreePages (Image->ImageContext.ImageAddress, Image->NumberOfPages); } ... CoreUnloadAndCloseImage() ... if ((Image->ImageBasePage != 0) && FreePage) { CoreFreePages (Image->ImageBasePage, Image->NumberOfPages); } ... This patch is to follow the suggestion at https://lists.01.org/pipermail/edk2-devel/2017-August/013112.html to set Image->ImageContext.ImageAddress and Image->ImageBasePage to 0 after the free in CoreLoadPeImage(). Cc: Liming Gao <liming.gao@intel.com> Cc: Andrew Fish <afish@apple.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> |
||
|---|---|---|
| .. | ||
| Dispatcher | ||
| DxeMain | ||
| Event | ||
| FwVol | ||
| FwVolBlock | ||
| Gcd | ||
| Hand | ||
| Image | ||
| Library | ||
| Mem | ||
| Misc | ||
| SectionExtraction | ||
| DxeCore.uni | ||
| DxeCoreExtra.uni | ||
| DxeMain.h | ||
| DxeMain.inf | ||