]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpProto.c
NetworkPkg: Remove superfluous return statement.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpProto.c
index 36c61e2e997adba39f9b02de8fa4c16eac58646b..2e8c42e62999154ed62cd1ff4ce5bca1f5bb15a8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for HttpDxe driver.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2016 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
@@ -1475,6 +1475,8 @@ HttpTransmitTcp (
 \r
   Status                = EFI_SUCCESS;\r
   Buffer                = NULL;\r
+  TempFragment.Len      = 0;\r
+  TempFragment.Bulk     = NULL;\r
 \r
   //\r
   // Need to encrypt data.\r
@@ -1489,7 +1491,7 @@ HttpTransmitTcp (
       Status = EFI_OUT_OF_RESOURCES;\r
       return Status;\r
     }\r
-    ((TLS_RECORD_HEADER *) Buffer)->ContentType = TLS_CONTENT_TYPE_APPLICATION_DATA;\r
+    ((TLS_RECORD_HEADER *) Buffer)->ContentType = TlsContentTypeApplicationData;\r
     ((TLS_RECORD_HEADER *) Buffer)->Version.Major = HttpInstance->TlsConfigData.Version.Major;\r
     ((TLS_RECORD_HEADER *) Buffer)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor;\r
     ((TLS_RECORD_HEADER *) Buffer)->Length = (UINT16) (TxStringLen);\r
@@ -1655,6 +1657,8 @@ HttpTcpTransmit (
   UINTN                     UrlSize;\r
   UINTN                     RequestMsgSize;\r
 \r
+  RequestMsg = NULL;\r
+\r
   ValueInItem = (HTTP_TOKEN_WRAP *) Item->Value;\r
   if (ValueInItem->TcpWrap.IsTxDone) {\r
     return EFI_SUCCESS;\r
@@ -1682,10 +1686,12 @@ HttpTcpTransmit (
                  );\r
   FreePool (Url);\r
 \r
-  if (EFI_ERROR (Status)){\r
+  if (EFI_ERROR (Status) || NULL == RequestMsg){\r
     return Status;\r
   }\r
 \r
+  ASSERT (RequestMsg != NULL);\r
+\r
   //\r
   // Transmit the request message.\r
   //\r