[edk2] [PATCH 16/17] BaseTools/GenSec: Fix potential memory leak

Hao Wu posted 17 patches 7 years ago
[edk2] [PATCH 16/17] BaseTools/GenSec: Fix potential memory leak
Posted by Hao Wu 7 years ago
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 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 ();
-- 
2.12.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel