From: Hao Wu Date: Tue, 11 Oct 2016 07:25:32 +0000 (+0800) Subject: BaseTools/VfrCompile: Fix potential memory leak X-Git-Tag: edk2-stable201903~5314 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=bdf5f73120b6db1b598a6ac7f17a9d5f6cca7c35 BaseTools/VfrCompile: Fix potential memory leak Cc: Liming Gao Cc: Yonghong Zhu Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp index d06c1bc96a..ec73529c20 100644 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp @@ -113,6 +113,7 @@ CFormPkg::CFormPkg ( } BufferStart = new CHAR8[BufferSize]; if (BufferStart == NULL) { + delete Node; return; } BufferEnd = BufferStart + BufferSize;