MdePkg DxeHstiLib: Fix memory leak issue
The Hsti returned from InternalHstiFindAip() and temporally allocated NewHsti need to be freed after used. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@@ -206,7 +206,7 @@ InternalHstiIsValidTable (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {
|
if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {
|
||||||
DEBUG ((EFI_D_ERROR, "ImplementationID is no NUL CHAR\n"));
|
DEBUG ((EFI_D_ERROR, "ImplementationID has no NUL CHAR\n"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,6 +416,7 @@ InternalHstiRecordFeaturesVerified (
|
|||||||
Hsti,
|
Hsti,
|
||||||
HstiSize
|
HstiSize
|
||||||
);
|
);
|
||||||
|
FreePool (Hsti);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,6 +546,8 @@ InternalHstiRecordErrorString (
|
|||||||
NewHsti,
|
NewHsti,
|
||||||
NewHstiSize
|
NewHstiSize
|
||||||
);
|
);
|
||||||
|
FreePool (Hsti);
|
||||||
|
FreePool (NewHsti);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user