Free 'SimpleTextOut->Mode' buffer before 'SimpleTextOut' is free.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19480
6f19259b-4bc3-4df7-8a09-
765794883524
*HandleLocation = ProtocolToReturn->TheHandle;\r
return ((EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)ProtocolToReturn);\r
} else {\r
- FreePool(ProtocolToReturn);\r
+ SHELL_FREE_NON_NULL(ProtocolToReturn->SimpleTextOut.Mode);\r
+ SHELL_FREE_NON_NULL(ProtocolToReturn);\r
return (NULL);\r
}\r
}\r
((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, \r
&gEfiSimpleTextOutProtocolGuid, \r
&(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut));\r
+ FreePool(SimpleTextOut->Mode);\r
FreePool(SimpleTextOut);\r
return (Status);\r
}\r