diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-10-11 15:24:15 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-11-08 16:37:47 +0800 |
commit | 076947cfceaa5c87f18306bd29b22caaa392d2f5 (patch) | |
tree | eacf481bc5ab52159227cd19d04e1acaa4285b1a /BaseTools/Source | |
parent | b14f278de4c8a3a5b8aec99d70083b02d786d6c9 (diff) | |
download | edk2-platforms-076947cfceaa5c87f18306bd29b22caaa392d2f5.tar.xz |
BaseTools/TianoCompress: 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')
-rw-r--r-- | BaseTools/Source/C/TianoCompress/TianoCompress.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/BaseTools/Source/C/TianoCompress/TianoCompress.c b/BaseTools/Source/C/TianoCompress/TianoCompress.c index 93cb6c3ac3..44dbccf9ad 100644 --- a/BaseTools/Source/C/TianoCompress/TianoCompress.c +++ b/BaseTools/Source/C/TianoCompress/TianoCompress.c @@ -1906,7 +1906,7 @@ Returns: FileBuffer = (UINT8 *) malloc (InputLength);
if (FileBuffer == NULL) {
Error (NULL, 0, 4001, "Resource:", "Memory cannot be allocated!");
- return 1;
+ goto ERROR;
}
Status = GetFileContents (
@@ -1917,8 +1917,8 @@ Returns: }
if (EFI_ERROR(Status)) {
- free(FileBuffer);
- return 1;
+ Error (NULL, 0, 0004, "Error getting contents of file: %s", InputFileName);
+ goto ERROR;
}
if (OutputFileName == NULL) {
|