From ae0fbb7f5ad41866bca89320f501282e173b373d Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Mon, 18 Dec 2017 15:59:53 +0800 Subject: [PATCH] BaseTools/GenSec: Fix potential memory leak Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Liming Gao --- BaseTools/Source/C/GenSec/GenSec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c index 5545f12b74..01d3bc4448 100644 --- a/BaseTools/Source/C/GenSec/GenSec.c +++ b/BaseTools/Source/C/GenSec/GenSec.c @@ -1670,7 +1670,11 @@ Finish: if (OutFile != NULL) { fclose (OutFile); } - + + if (DummyFileBuffer != NULL) { + free (DummyFileBuffer); + } + VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ()); return GetUtilityStatus ();