audk/MdeModulePkg/Core/Dxe
Jian J Wang 8a7ff892ca MdeModulePkg/Core: fill logic hole in MemoryProtectionCpuArchProtocolNotify
At the end of of MemoryProtectionCpuArchProtocolNotify there's cleanup
code to free resource. But at line 978, 994, 1005 the function returns
directly. This patch use "goto" to replace "return" to make sure the
resource is freed before exit.

1029:  CoreCloseEvent (Event);
1030:  return;

There's another memory leak after calling gBS->LocateHandleBuffer() in
the same function:

  Status = gBS->LocateHandleBuffer (
                  ByProtocol,
                  &gEfiLoadedImageProtocolGuid,
                  NULL,
                  &NoHandles,
                  &HandleBuffer
                  );

HandleBuffer is allocated in above call but never freed. This patch
will also add code to free it.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-11-07 23:08:26 +08:00
..
Dispatcher MdeModulePkg DxeCore: Handle multiple FV images in one FV file 2018-09-03 17:04:58 +08:00
DxeMain MdeModulePkg Core/Dxe: Remove redundant functions 2018-08-21 16:29:04 +08:00
Event MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
FwVol MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
FwVolBlock MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
Gcd MdeModulePkg/Core: fix an issue of potential NULL pointer access 2018-10-30 10:16:03 +08:00
Hand MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
Image MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
Library
Mem MdeModulePkg/Core: correct one coding style 2018-10-27 21:33:13 +08:00
Misc MdeModulePkg/Core: fill logic hole in MemoryProtectionCpuArchProtocolNotify 2018-11-07 23:08:26 +08:00
SectionExtraction MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
DxeCore.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
DxeCoreExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
DxeMain.h MdeModulePkg Core/Dxe: Remove redundant functions 2018-08-21 16:29:04 +08:00
DxeMain.inf MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00