diff options
| author | Star Zeng <star.zeng@intel.com> | 2017-08-11 06:02:39 +0300 |
|---|---|---|
| committer | Star Zeng <star.zeng@intel.com> | 2017-08-14 11:45:59 +0300 |
| commit | d9af5af8d96866821e50882fbd45686c28aaafed (patch) | |
| tree | 981af83ad0e5ed51239f0358e0948aff5da9ba98 /BaseTools/Source/Python/AutoGen/IdfClassObject.py | |
| parent | 0024172d909ec73a9ce9ffdfc9fdd4382080e110 (diff) | |
| download | edk2-d9af5af8d96866821e50882fbd45686c28aaafed.tar.xz | |
MdeModulePkg DxeCore: Fix double free pages on LoadImage failure path
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>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/IdfClassObject.py')
0 files changed, 0 insertions, 0 deletions
