]> granicus.if.org Git - curl/commitdiff
Dan Becker fixed a minor memory leak on persistent connnections using
authorDaniel Stenberg <daniel@haxx.se>
Tue, 26 Nov 2002 17:32:15 +0000 (17:32 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 26 Nov 2002 17:32:15 +0000 (17:32 +0000)
FOLLOWLOCATION and CURLOPT_USERPWD.

lib/http.c

index 903deb2294ecdd0fc9a32efe4c6030add31d83a7..92143c4a7c2a8947767a4322e071356e0524dce3 100644 (file)
@@ -440,6 +440,10 @@ CURLcode Curl_http_connect(struct connectdata *conn)
   if(conn->bits.user_passwd && !data->state.this_is_a_follow) {
     /* Authorization: is requested, this is not a followed location, get the
        original host name */
+    if (data->state.auth_host)
+      /* Free to avoid leaking memory on multiple requests*/
+      free(data->state.auth_host);
+
     data->state.auth_host = strdup(conn->hostname);
   }