Hi Cecil,

Thanks for your comments!
I agree with you proposal. 

Hi All,
I will send a new patch to remove the useless code.
Please ignore this one!


Thanks,
Dandan

-----Original Message-----
From: Sheng, Cecil (HPS SW) [mailto:[email protected]] 
Sent: Friday, May 20, 2016 7:52 AM
To: Bi, Dandan <[email protected]>; [email protected]
Cc: Qiu, Shumin <[email protected]>; Dong, Eric <[email protected]>
Subject: RE: [edk2] [patch] MdeModulePkg/DisplayEngine: Fix memory leak issues 
in DisplayEngine

Hi Dandan,

The InputHandle.c one looks good. About the ProcessOptions.c one, I propose 
remove the lines starting "FreePool (StringPtr)", the following "if (EFI_ERROR 
(Status))" because it's  useless, and the "return Status" line. Then the 
clean-up block at the end of function frees the strings.


Sincerely,

Cecil Sheng
ISS Firmware Development
HPE Servers


-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Dandan Bi
Sent: Thursday, May 19, 2016 7:30 PM
To: [email protected]
Cc: Qiu Shumin <[email protected]>; Eric Dong <[email protected]>
Subject: [edk2] [patch] MdeModulePkg/DisplayEngine: Fix memory leak issues in 
DisplayEngine

Cc: Qiu Shumin <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Eric Dong <[email protected]>
---
 MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c   | 5 +----
 MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c | 3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c 
b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
index 732dd2f..8e7b735 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
@@ -1,9 +1,9 @@
 /** @file
 Implementation for handling user input from the User Interfaces.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2016, 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  
http://opensource.org/licenses/bsd-license.php
 
@@ -1297,13 +1297,10 @@ GetSelectionInputPopUp (
   ValueType         = 0;
   CurrentOption     = NULL;
   ShowDownArrow     = FALSE;
   ShowUpArrow       = FALSE;
 
-  StringPtr = AllocateZeroPool ((gOptionBlockWidth + 1) * 2);
-  ASSERT (StringPtr);
-
   ZeroMem (&HiiValue, sizeof (EFI_HII_VALUE));
 
   Question = MenuOption->ThisTag;
   if (Question->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
     Link = GetFirstNode (&Question->OptionListHead); diff --git 
a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c 
b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
index bb2faf3..16aaf6c 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
@@ -1,10 +1,10 @@
 /** @file
 Implementation for handling the User Interface option processing.
 
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2016, 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  
http://opensource.org/licenses/bsd-license.php
 
@@ -884,10 +884,11 @@ PasswordProcess (
     gUserInput->InputValue.Buffer = AllocateCopyPool 
(Question->CurrentValue.BufferLen, StringPtr);
     gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
     gUserInput->InputValue.Type = Question->CurrentValue.Type;
     gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, 
gUserInput->InputValue.Value.string, StringPtr, NULL);
     FreePool (StringPtr); 
+    FreePool (TempString);
 
     Status = EFI_SUCCESS;
 
     if (EFI_ERROR (Status)) {
       //
--
1.9.5.msysgit.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

Reply via email to