From 86702b3fa9437301a6ae02df610ad3ca15fc860a Mon Sep 17 00:00:00 2001 From: erictian Date: Tue, 3 Jul 2012 03:24:47 +0000 Subject: DuetPkg/SataController: Fix possible memory leak at error handling of SataController driver Signed-off-by: Feng Tian Reviewed-by: Jie Lin Reviewed-by: Ruiyu Ni git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13482 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/SataControllerDxe/SataController.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'DuetPkg') 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; } -- cgit v1.2.3