summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-10-11 15:08:17 +0800
committerHao Wu <hao.a.wu@intel.com>2016-11-08 16:37:36 +0800
commit3f63e1755149286bef02b5d84841f7d9b1dffe95 (patch)
treeeb551e5e85988780d6962776524307c320f66970 /BaseTools/Source/C
parent6db97871107cba3d92ec2f3b7eb350f1fff47a11 (diff)
downloadedk2-platforms-3f63e1755149286bef02b5d84841f7d9b1dffe95.tar.xz
BaseTools/GenPage: Fix potential memory leak
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>
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r--BaseTools/Source/C/GenPage/GenPage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/BaseTools/Source/C/GenPage/GenPage.c b/BaseTools/Source/C/GenPage/GenPage.c
index e22485c4ae..3bb05efa36 100644
--- a/BaseTools/Source/C/GenPage/GenPage.c
+++ b/BaseTools/Source/C/GenPage/GenPage.c
@@ -431,9 +431,11 @@ main (
//
result = GenBinPage (BaseMemory, InputFile, OutputFile);
if (result < 0) {
+ free (BaseMemory);
return STATUS_ERROR;
}
+ free (BaseMemory);
return 0;
}