From 50c10aa5bf545eedfdbe561116656b6ec12654cd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 1 Aug 2007 21:20:01 +0000 Subject: Patrick Monnerat and I modified libcurl so that now it *copies* all strings passed to it with curl_easy_setopt()! Previously it has always just refered to the data, forcing the user to keep the data around until libcurl is done with it. That is now history and libcurl will instead clone the given strings and keep private copies. --- lib/easy.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/easy.c') diff --git a/lib/easy.c b/lib/easy.c index b1080a22d..54915fb88 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -579,7 +579,8 @@ CURL *curl_easy_duphandle(CURL *incurl) outcurl->state.headersize=HEADERSIZE; /* copy all userdefined values */ - outcurl->set = data->set; + if (Curl_dupset(outcurl, data) != CURLE_OK) + break; if(data->state.used_interface == Curl_if_multi) outcurl->state.connc = data->state.connc; @@ -658,6 +659,7 @@ CURL *curl_easy_duphandle(CURL *incurl) free(outcurl->change.url); if(outcurl->change.referer) free(outcurl->change.referer); + Curl_freeset(outcurl); free(outcurl); /* free the memory again */ outcurl = NULL; } @@ -681,6 +683,7 @@ void curl_easy_reset(CURL *curl) data->reqdata.proto.generic=NULL; /* zero out UserDefined data: */ + Curl_freeset(data); memset(&data->set, 0, sizeof(struct UserDefined)); /* zero out Progress data: */ @@ -732,7 +735,7 @@ void curl_easy_reset(CURL *curl) data->set.ssl.verifyhost = 2; #ifdef CURL_CA_BUNDLE /* This is our prefered CA cert bundle since install time */ - data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE; + (void) curl_easy_setopt(curl, CURLOPT_CAINFO, (char *) CURL_CA_BUNDLE); #endif data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth -- cgit v1.2.1