* Dp uses this information to group records in different ways. It also uses\r
* timer information to calculate elapsed time for each measurement.\r
*\r
- * Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ * Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
* which accompanies this distribution. The full text of the license may be found at\r
\r
///@}\r
\r
+/**\r
+ Wrap original FreePool to check NULL pointer first.\r
+**/\r
+VOID\r
+SafeFreePool (\r
+ IN VOID *Buffer\r
+ )\r
+{\r
+ if (Buffer != NULL) {\r
+ FreePool (Buffer);\r
+ }\r
+}\r
+\r
/**\r
Transfer the param list value and get the command line parse.\r
\r
ListIndex ++;\r
} \r
FreePool (DpParamList);\r
- \r
- FreePool (StringDpOptionQh);\r
- FreePool (StringDpOptionLh);\r
- FreePool (StringDpOptionUh);\r
- FreePool (StringDpOptionLv);\r
- FreePool (StringDpOptionUs);\r
- FreePool (StringDpOptionLs);\r
- FreePool (StringDpOptionUa);\r
- FreePool (StringDpOptionUr);\r
- FreePool (StringDpOptionUt);\r
- FreePool (StringDpOptionUp);\r
- FreePool (StringDpOptionLx);\r
- FreePool (StringDpOptionLn);\r
- FreePool (StringDpOptionLt); \r
- FreePool (StringPtr);\r
- FreePool (mPrintTokenBuffer);\r
- \r
+\r
+ SafeFreePool (StringDpOptionQh);\r
+ SafeFreePool (StringDpOptionLh);\r
+ SafeFreePool (StringDpOptionUh);\r
+ SafeFreePool (StringDpOptionLv);\r
+ SafeFreePool (StringDpOptionUs);\r
+ SafeFreePool (StringDpOptionLs);\r
+ SafeFreePool (StringDpOptionUa);\r
+ SafeFreePool (StringDpOptionUr);\r
+ SafeFreePool (StringDpOptionUt);\r
+ SafeFreePool (StringDpOptionUp);\r
+ SafeFreePool (StringDpOptionLx);\r
+ SafeFreePool (StringDpOptionLn);\r
+ SafeFreePool (StringDpOptionLt);\r
+ SafeFreePool (StringPtr);\r
+ SafeFreePool (mPrintTokenBuffer);\r
+\r
HiiRemovePackages (gHiiHandle);\r
return Status;\r
}\r