diff options
author | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-03 03:24:47 +0000 |
---|---|---|
committer | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-03 03:24:47 +0000 |
commit | 86702b3fa9437301a6ae02df610ad3ca15fc860a (patch) | |
tree | 0312160984b0977ea8e12ae795c3e917da681825 /DuetPkg | |
parent | 6d896ff1cb89aa29830a6da0678a10d777f13021 (diff) | |
download | edk2-platforms-86702b3fa9437301a6ae02df610ad3ca15fc860a.tar.xz |
DuetPkg/SataController: Fix possible memory leak at error handling of SataController driver
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jie Lin <jie.lin@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13482 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg')
-rw-r--r-- | DuetPkg/SataControllerDxe/SataController.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/DuetPkg/SataControllerDxe/SataController.c b/DuetPkg/SataControllerDxe/SataController.c index d1e85cc6e4..1807c88224 100644 --- a/DuetPkg/SataControllerDxe/SataController.c +++ b/DuetPkg/SataControllerDxe/SataController.c @@ -920,6 +920,7 @@ IdeInitCalculateMode ( *SupportedModes = AllocateZeroPool (sizeof (EFI_ATA_COLLECTIVE_MODE));
if (*SupportedModes == NULL) {
+ ASSERT (*SupportedModes != NULL);
return EFI_OUT_OF_RESOURCES;
}
@@ -931,6 +932,7 @@ IdeInitCalculateMode ( // Make sure we've got the valid identify data of the device from SubmitData()
//
if (!IdentifyValid) {
+ FreePool (*SupportedModes);
return EFI_NOT_READY;
}
|