mirror of
https://github.com/utmapp/edk2.git
synced 2026-12-01 14:00:40 -10:00
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 <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <[email protected]> Reviewed-by: Liming Gao <[email protected]>