]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg DxeCore: Only free ScratchBuffer when it is not NULL
authorStar Zeng <star.zeng@intel.com>
Fri, 23 Jun 2017 09:44:12 +0000 (17:44 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 26 Jun 2017 05:17:16 +0000 (13:17 +0800)
commit4777032247fb3cbc8325881572aa8a83ccd9db93
tree75864b444955b810ea7dbfd38b0f77ff56f89199
parent45cfcd8dccf84b8abbc1d6f587fedb5d2037ec79
MdeModulePkg DxeCore: Only free ScratchBuffer when it is not NULL

There is a case that ExtractGuidedSectionGetInfo return 0 for
ScratchBufferSize and ScratchBuffer will be NULL, after AllocatePool
fails to allocate buffer for AllocatedOutputBuffer, the code will
call FreePool (ScratchBuffer), but ScratchBuffer == NULL.

This patch is to only free ScratchBuffer when it is not NULL.

Cc: Liming Gao <liming.gao@intel.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>
MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c