]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/Dp.c
ShellPkg: Add NULL check to pointer returned from 'AllocateZeroPool'.
[mirror_edk2.git] / ShellPkg / Library / UefiDpLib / Dp.c
index 4d109d037c1b38f255a03e3cb06c9cd00ad403a8..6b06d20749f29c3bc695abd99880fa294061456e 100644 (file)
@@ -13,7 +13,7 @@
   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
   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 - 2013, Intel Corporation. All rights reserved.\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.\r
   (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -256,6 +256,7 @@ ShellCommandRunDp (
   CustomCumulativeToken = ShellCommandLineGetValue (ParamPackage, L"-c");\r
   if (CustomCumulativeToken != NULL) {\r
     CustomCumulativeData = AllocateZeroPool (sizeof (PERF_CUM_DATA));\r
   CustomCumulativeToken = ShellCommandLineGetValue (ParamPackage, L"-c");\r
   if (CustomCumulativeToken != NULL) {\r
     CustomCumulativeData = AllocateZeroPool (sizeof (PERF_CUM_DATA));\r
+    ASSERT (CustomCumulativeData != NULL);\r
     CustomCumulativeData->MinDur = 0;\r
     CustomCumulativeData->MaxDur = 0;\r
     CustomCumulativeData->Count  = 0;\r
     CustomCumulativeData->MinDur = 0;\r
     CustomCumulativeData->MaxDur = 0;\r
     CustomCumulativeData->Count  = 0;\r