]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/Ikev2/Info.c
NetworkPkg: Remove ASSERT and use error handling in IpSecDxe
[mirror_edk2.git] / NetworkPkg / IpSecDxe / Ikev2 / Info.c
index fe75d6c59610d357f354be249fcc710a281e2c88..23e47ceea8a652658d836530375c2f64565088c2 100644 (file)
@@ -2,7 +2,7 @@
   The Implementations for Information Exchange.\r
 \r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -47,7 +47,9 @@ Ikev2InfoGenerator (
   InfoContext  = NULL;\r
   IkeSaSession = (IKEV2_SA_SESSION *) SaSession;\r
   IkePacket    = IkePacketAlloc ();\r
-  ASSERT (IkePacket != NULL);\r
+  if (IkePacket == NULL) {\r
+    return NULL;\r
+  }\r
 \r
   //\r
   // Fill IkePacket Header.\r