summaryrefslogtreecommitdiff
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-07-14 16:47:59 +0800
committerStar Zeng <star.zeng@intel.com>2017-07-18 10:35:36 +0800
commit357c48258e0b452d31f487a47dca486ba666a954 (patch)
tree07d321c1ed68522a95ee90749029a6679fdd2551 /MdePkg/Library
parentfaa02c7fa7747abb8dba12cb118e1c0e1ad02204 (diff)
downloadedk2-357c48258e0b452d31f487a47dca486ba666a954.zip
edk2-357c48258e0b452d31f487a47dca486ba666a954.tar.gz
edk2-357c48258e0b452d31f487a47dca486ba666a954.tar.bz2
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>
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/DxeHstiLib/HstiDxe.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c
index c032a98..5851076 100644
--- a/MdePkg/Library/DxeHstiLib/HstiDxe.c
+++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c
@@ -1,6 +1,6 @@
/** @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
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
@@ -206,7 +206,7 @@ InternalHstiIsValidTable (
}
}
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;
}
@@ -416,6 +416,7 @@ InternalHstiRecordFeaturesVerified (
Hsti,
HstiSize
);
+ FreePool (Hsti);
return Status;
}
@@ -545,6 +546,8 @@ InternalHstiRecordErrorString (
NewHsti,
NewHstiSize
);
+ FreePool (Hsti);
+ FreePool (NewHsti);
return Status;
}