Sunny, You could move the two FreePool (FullInstance) to one place which is under the LocateDevicePath() call to make the change smaller a bit. What do you think?
Thanks, Ray -----Original Message----- From: Wang, Sunny (HPS SW) [mailto:[email protected]] Sent: Friday, October 30, 2015 6:21 PM To: Ni, Ruiyu <[email protected]> Cc: Tian, Feng <[email protected]>; El-Haj-Mahmoud, Samer <[email protected]>; Wang, Sunny (HPS SW) <[email protected]>; [email protected] Subject: RE: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues Hi Ray, Are you the owner of this module (UefiBootManagerLib)? If so, could you help to review and commit it? If not, could you tell me who is the owner? In addition, the attached patch would also need your help to get committed. Thanks! Regards, Sunny Wang -----Original Message----- From: Tian, Feng [mailto:[email protected]] Sent: Thursday, October 29, 2015 8:21 AM To: El-Haj-Mahmoud, Samer; Wang, Sunny (HPS SW); [email protected] Cc: Tian, Feng Subject: RE: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues Importance: High I will let module owner review and commit it. Thanks Feng -----Original Message----- From: El-Haj-Mahmoud, Samer [mailto:[email protected]] Sent: Wednesday, October 28, 2015 22:58 To: Wang, Sunny (HPS SW); [email protected]; Tian, Feng Subject: RE: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues + MdeModuklePkg maintainers. Can someone help by committing this please? -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of El-Haj-Mahmoud, Samer Sent: Tuesday, October 27, 2015 10:14 AM To: Wang, Sunny (HPS SW) <[email protected]>; [email protected] Subject: Re: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues Reviewed-by: Samer El-Haj-Mahmoud <[email protected]> -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Wang, Sunny (HPS SW) Sent: Tuesday, October 27, 2015 3:47 AM To: [email protected] Cc: El-Haj-Mahmoud, Samer <[email protected]> Subject: [edk2] [PATCH] MdeModulePkg: Fix memory leak issues Fix memory leak issues Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <[email protected]> --- MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c index 86b4fac..0830166 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c @@ -2,6 +2,7 @@ Library functions which contain all the code to connect console device. Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR> +(C) Copyright 2015 Hewlett Packard Enterprise Development LP<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 @@ -301,6 +302,7 @@ BmUpdateSystemTableConsole ( EFI_DEVICE_PATH_PROTOCOL *FullDevicePath; EFI_DEVICE_PATH_PROTOCOL *VarConsole; EFI_DEVICE_PATH_PROTOCOL *Instance; + EFI_DEVICE_PATH_PROTOCOL *FullInstance; VOID *Interface; EFI_HANDLE NewHandle; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut; @@ -354,6 +356,7 @@ BmUpdateSystemTableConsole ( // // Find console device handle by device path instance // + FullInstance = Instance; Status = gBS->LocateDevicePath ( ConsoleGuid, &Instance, @@ -383,15 +386,18 @@ BmUpdateSystemTableConsole ( TextOut->SetMode (TextOut, 0); } } + FreePool (FullDevicePath); + FreePool (FullInstance); return TRUE; } } - + FreePool (FullInstance); } while (Instance != NULL); // // No any available console devcie found. // + FreePool (FullDevicePath); return FALSE; } -- 2.5.0.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

