]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
can just as well NULLify the pointer in a single spot
authorDaniel Stenberg <daniel@haxx.se>
Sun, 11 Mar 2007 22:48:58 +0000 (22:48 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 11 Mar 2007 22:48:58 +0000 (22:48 +0000)
lib/url.c

index 644cec39ad278d7042fbe175c3415e78e4d87951..2fcc31f3313fd7b156c46a7c4516872161582082 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4223,9 +4223,6 @@ CURLcode Curl_done(struct connectdata **connp,
   if(data->set.reuse_forbid || conn->bits.close) {
     CURLcode res2 = Curl_disconnect(conn); /* close the connection */
 
-    *connp = NULL; /* to make the caller of this function better detect that
-                      this was actually killed here */
-
     /* If we had an error already, make sure we return that one. But
        if we got a new error, return that. */
     if(!result && res2)
@@ -4240,12 +4237,13 @@ CURLcode Curl_done(struct connectdata **connp,
     infof(data, "Connection #%ld to host %s left intact\n",
           conn->connectindex,
           conn->bits.httpproxy?conn->proxy.dispname:conn->host.dispname);
-
-    *connp = NULL; /* to make the caller of this function better detect that
-                      this connection is handed over and no longer used from
-                      this point on */
   }
 
+  *connp = NULL; /* to make the caller of this function better detect that
+                    this was either closed or handed over to the connection
+                    cache here, and therefore cannot be used from this point on
+                 */
+
   return result;
 }