]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/GenPage: Fix potential memory leak
authorHao Wu <hao.a.wu@intel.com>
Tue, 11 Oct 2016 07:08:17 +0000 (15:08 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:37:36 +0000 (16:37 +0800)
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/GenPage/GenPage.c

index e22485c4ae26f352c48ee771a0a9f24251140cec..3bb05efa36cd06b86c31f4b6eb08ee8144d83058 100644 (file)
@@ -431,9 +431,11 @@ main (
   //\r
   result = GenBinPage (BaseMemory, InputFile, OutputFile);\r
   if (result < 0) {\r
   //\r
   result = GenBinPage (BaseMemory, InputFile, OutputFile);\r
   if (result < 0) {\r
+    free (BaseMemory);\r
     return STATUS_ERROR;\r
   }\r
 \r
     return STATUS_ERROR;\r
   }\r
 \r
+  free (BaseMemory);\r
   return 0;\r
 }\r
 \r
   return 0;\r
 }\r
 \r