]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
NetworkPkg: Enhance the NULL pointer check before dereference it.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 76c95b2bb66a3be299c56a321770168493ec939e..50c061743665b4c1511b5a849dca76dca0833029 100644 (file)
@@ -316,7 +316,7 @@ EfiHttpRequest (
   Configure   = TRUE;\r
   ReConfigure = TRUE;  \r
 \r
-  if (HttpInstance->RemoteHost == NULL && HttpInstance->RemotePort == 0) {\r
+  if (HttpInstance->RemoteHost == NULL) {\r
     //\r
     // Request() is called the first time. \r
     //\r
@@ -373,6 +373,7 @@ EfiHttpRequest (
       if (HttpInstance->RemoteHost != NULL) {\r
         FreePool (HttpInstance->RemoteHost);\r
         HttpInstance->RemoteHost = NULL;\r
+        HttpInstance->RemotePort = 0;\r
       }\r
     }\r
   } \r