mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
b14f278de4
commit
076947cfce
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue