Add pointer check for NULL before dereference it.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / EsalVariableDxeSal / Variable.c
index d6c66863512b58e0b65c865c541d3d91ab2a3443..2be925d2366ad84b976f2d62aebf3606aaee288d 100644 (file)
@@ -846,6 +846,7 @@ UpdateVariableCache (
           // If size of data changes, allocate pool and copy data.\r
           //\r
           Entry->Data = AllocatePool (DataSize);\r
+          ASSERT (Entry->Data != NULL);\r
           Entry->DataSize = DataSize;\r
           CopyMem (Entry->Data, Data, DataSize);\r
         }\r