aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-11-26 17:32:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-11-26 17:32:15 +0000
commite5e2fb82744daa7f9db77bd6a7168af30ff74330 (patch)
tree8b518338f95d455d1ad875801af2fa489552c078 /lib
parent0210b3c8935e6faf5c929e7b9f360f42bc1c3995 (diff)
Dan Becker fixed a minor memory leak on persistent connnections using
FOLLOWLOCATION and CURLOPT_USERPWD.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/http.c b/lib/http.c
index 903deb229..92143c4a7 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -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);
}