Skip to content

Commit

Permalink
PerformancePkg\Dp_App: Add NULL check to pointer returned from 'Alloc…
Browse files Browse the repository at this point in the history
…ateZeroPool'.

When CustomCumulativeToken is not NULL, the CustomCumulativeData is expected non-NULL.
Add 'ASSERT' statement to ensure this.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18955 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
Qiu Shumin authored and shenshushi committed Nov 26, 2015
1 parent 01e3a97 commit c4ace58
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PerformancePkg/Dp_App/Dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Dp uses this information to group records in different ways. It also uses
timer information to calculate elapsed time for each measurement.
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 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
Expand Down Expand Up @@ -368,6 +368,7 @@ InitializeDp (
CustomCumulativeToken = ShellCommandLineGetValue (ParamPackage, StringDpOptionLc);
if (CustomCumulativeToken != NULL) {
CustomCumulativeData = AllocateZeroPool (sizeof (PERF_CUM_DATA));
ASSERT (CustomCumulativeData != NULL);
CustomCumulativeData->MinDur = 0;
CustomCumulativeData->MaxDur = 0;
CustomCumulativeData->Count = 0;
Expand Down

0 comments on commit c4ace58

Please sign in to comment.