Index: lib/easy.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/easy.c,v
retrieving revision 1.106
diff -u -r1.106 easy.c
--- lib/easy.c	23 Jul 2007 18:51:22 -0000	1.106
+++ lib/easy.c	29 Jul 2007 13:36:45 -0000
@@ -579,7 +579,8 @@
     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 @@
         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 @@
   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 @@
   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
Index: lib/getinfo.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/getinfo.c,v
retrieving revision 1.57
diff -u -r1.57 getinfo.c
--- lib/getinfo.c	2 Apr 2007 03:38:18 -0000	1.57
+++ lib/getinfo.c	29 Jul 2007 13:36:46 -0000
@@ -176,7 +176,7 @@
     *param_charp = data->info.contenttype;
     break;
   case CURLINFO_PRIVATE:
-    *param_charp = data->set.private_data;
+    *param_charp = (char *) data->set.private_data;
     break;
   case CURLINFO_HTTPAUTH_AVAIL:
     *param_longp = data->info.httpauthavail;
Index: lib/url.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/url.c,v
retrieving revision 1.630
diff -u -r1.630 url.c
--- lib/url.c	29 Jul 2007 12:54:05 -0000	1.630
+++ lib/url.c	29 Jul 2007 13:36:47 -0000
@@ -217,6 +217,233 @@
     ; /* empty loop */
 }
 
+void Curl_freeset(struct SessionHandle * data)
+{
+  /* Free all dynamic strings stored in the data->set substructure. */
+
+  Curl_safefree(data->set.cert);
+  Curl_safefree(data->set.cert_type);
+  Curl_safefree(data->set.cookie);
+  Curl_safefree(data->set.cookiejar);
+  Curl_safefree(data->set.customrequest);
+  Curl_safefree(data->set.device);
+  Curl_safefree(data->set.encoding);
+  Curl_safefree(data->set.ftp_account);
+  Curl_safefree(data->set.ftp_alternative_to_user);
+  Curl_safefree(data->set.ftpport);
+  Curl_safefree(data->set.key);
+  Curl_safefree(data->set.key_passwd);
+  Curl_safefree(data->set.key_type);
+  Curl_safefree(data->set.krb_level);
+  Curl_safefree(data->set.netrc_file);
+  Curl_safefree(data->set.postfields);
+  Curl_safefree(data->set.proxy);
+  Curl_safefree(data->set.proxyuserpwd);
+  Curl_safefree(data->set.set_range);
+  Curl_safefree(data->set.set_referer);
+  Curl_safefree(data->set.set_url);
+  Curl_safefree(data->set.ssh_private_key);
+  Curl_safefree(data->set.ssh_public_key);
+  Curl_safefree(data->set.ssl.CAfile);
+  Curl_safefree(data->set.ssl.CApath);
+  Curl_safefree(data->set.ssl.cipher_list);
+  Curl_safefree(data->set.ssl.egdsocket);
+  Curl_safefree(data->set.ssl.random_file);
+  Curl_safefree(data->set.useragent);
+  Curl_safefree(data->set.userpwd);
+}
+
+static CURLcode Curl_setstropt(char **charp, char * s)
+{
+  /* Release the previous storage at `charp' and replace by a dynamic storage
+     copy of `s'. Return CURLE_OK or CURLE_OUT_OF_MEMORY. */
+
+  if (*charp) {
+    free(*charp);
+    *charp = (char *) NULL;
+  }
+
+  if (s) {
+    s = strdup(s);
+
+    if (!s)
+      return CURLE_OUT_OF_MEMORY;
+
+    *charp = s;
+  }
+
+  return CURLE_OK;
+}
+
+CURLcode Curl_dupset(struct SessionHandle * dst, struct SessionHandle * src)
+{
+  CURLcode r;
+
+  /* Copy src->set into dst->set, taking care of duplifying dynamic strings */
+  dst->set = src->set;
+
+  /* Make sure strdup'ed string pointers do not point to source strings. */
+  dst->set.cert = NULL;
+  dst->set.cert_type = NULL;
+  dst->set.cookie = NULL;
+  dst->set.cookiejar = NULL;
+  dst->set.customrequest = NULL;
+  dst->set.device = NULL;
+  dst->set.encoding = NULL;
+  dst->set.ftp_account = NULL;
+  dst->set.ftp_alternative_to_user = NULL;
+  dst->set.ftpport = NULL;
+  dst->set.key = NULL;
+  dst->set.key_passwd = NULL;
+  dst->set.key_type = NULL;
+  dst->set.krb_level = NULL;
+  dst->set.netrc_file = NULL;
+  dst->set.postfields = NULL;
+  dst->set.proxy = NULL;
+  dst->set.proxyuserpwd = NULL;
+  dst->set.set_range = NULL;
+  dst->set.set_referer = NULL;
+  dst->set.set_url = NULL;
+  dst->set.ssh_private_key = NULL;
+  dst->set.ssh_public_key = NULL;
+  dst->set.ssl.CAfile = NULL;
+  dst->set.ssl.CApath = NULL;
+  dst->set.ssl.cipher_list = NULL;
+  dst->set.ssl.egdsocket = NULL;
+  dst->set.ssl.random_file = NULL;
+  dst->set.useragent = NULL;
+  dst->set.userpwd = NULL;
+
+  /* copy strings. */
+
+  do {
+    r = Curl_setstropt(&dst->set.cert, src->set.cert);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.cert_type, src->set.cert_type);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.cookie, src->set.cookie);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.cookiejar, src->set.cookiejar);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.customrequest, src->set.customrequest);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.device, src->set.device);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.encoding, src->set.encoding);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ftp_account, src->set.ftp_account);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ftp_alternative_to_user,
+                       src->set.ftp_alternative_to_user);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ftpport, src->set.ftpport);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.key, src->set.key);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.key_passwd, src->set.key_passwd);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.key_type, src->set.key_type);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.krb_level, src->set.krb_level);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.netrc_file, src->set.netrc_file);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.postfields, src->set.postfields);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.proxy, src->set.proxy);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.proxyuserpwd, src->set.proxyuserpwd);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.set_range, src->set.set_range);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.set_referer, src->set.set_referer);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.set_url, src->set.set_url);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssh_private_key, src->set.ssh_private_key);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssh_public_key, src->set.ssh_public_key);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssl.CAfile, src->set.ssl.CAfile);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssl.CApath, src->set.ssl.CApath);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssl.cipher_list, src->set.ssl.cipher_list);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssl.egdsocket, src->set.ssl.egdsocket);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.ssl.random_file, src->set.ssl.random_file);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.useragent, src->set.useragent);
+    if (r != CURLE_OK)
+      break;
+
+    r = Curl_setstropt(&dst->set.userpwd, src->set.userpwd);
+    if (r != CURLE_OK)
+      break;
+  } while (0);
+
+  /* If a failure occured, freeing has to be performed externally. */
+
+  return r;
+}
+
 /*
  * This is the internal function curl_easy_cleanup() calls. This should
  * cleanup and free all resources associated with this sessionhandle.
@@ -381,6 +608,7 @@
     Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
   }
 
+  Curl_freeset(data);
   free(data);
   return CURLE_OK;
 }
@@ -609,7 +837,7 @@
     data->set.ssl.sessionid = TRUE; /* session ID caching enabled by default */
 #ifdef CURL_CA_BUNDLE
     /* This is our preferred CA cert bundle since install time */
-    data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE;
+    res = Curl_setstropt(&data->set.ssl.CAfile, (char *) CURL_CA_BUNDLE);
 #endif
   }
 
@@ -617,6 +845,7 @@
     ares_destroy(data->state.areschannel);
     if(data->state.headerbuff)
       free(data->state.headerbuff);
+    Curl_freeset(data);
     free(data);
     data = NULL;
   }
@@ -648,7 +877,7 @@
     break;
   case CURLOPT_SSL_CIPHER_LIST:
     /* set a list of cipher we want to use in the SSL connection */
-    data->set.ssl.cipher_list = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssl.cipher_list, va_arg(param, char *));
     break;
 
   case CURLOPT_RANDOM_FILE:
@@ -656,13 +885,13 @@
      * This is the path name to a file that contains random data to seed
      * the random SSL stuff with. The file is only used for reading.
      */
-    data->set.ssl.random_file = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssl.random_file, va_arg(param, char *));
     break;
   case CURLOPT_EGDSOCKET:
     /*
      * The Entropy Gathering Daemon socket pathname
      */
-    data->set.ssl.egdsocket = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssl.egdsocket, va_arg(param, char *));
     break;
   case CURLOPT_MAXCONNECTS:
     /*
@@ -785,7 +1014,7 @@
     /*
      * Use this file instead of the $HOME/.netrc file
      */
-    data->set.netrc_file = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.netrc_file, va_arg(param, char *));
     break;
   case CURLOPT_TRANSFERTEXT:
     /*
@@ -836,9 +1065,9 @@
      * and ignore an received Content-Encoding header.
      *
      */
-    data->set.encoding = va_arg(param, char *);
-    if(data->set.encoding && !*data->set.encoding)
-      data->set.encoding = (char*)ALL_CONTENT_ENCODINGS;
+    argptr = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.encoding, (argptr && !*argptr)?
+      (char *) ALL_CONTENT_ENCODINGS: argptr);
     break;
 
   case CURLOPT_FOLLOWLOCATION:
@@ -881,7 +1110,7 @@
     /*
      * A string with POST data. Makes curl HTTP POST. Even if it is NULL.
      */
-    data->set.postfields = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.postfields, va_arg(param, char *));
     data->set.httpreq = HTTPREQ_POST;
     break;
 
@@ -918,7 +1147,7 @@
       free(data->change.referer);
       data->change.referer_alloc = FALSE;
     }
-    data->set.set_referer = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.set_referer, va_arg(param, char *));
     data->change.referer = data->set.set_referer;
     break;
 
@@ -926,7 +1155,7 @@
     /*
      * String to use in the HTTP User-Agent field
      */
-    data->set.useragent = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.useragent, va_arg(param, char *));
     break;
 
   case CURLOPT_HTTPHEADER:
@@ -948,7 +1177,7 @@
     /*
      * Cookie string to send to the remote server in the request.
      */
-    data->set.cookie = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.cookie, va_arg(param, char *));
     break;
 
   case CURLOPT_COOKIEFILE:
@@ -973,7 +1202,7 @@
     /*
      * Set cookie file name to dump all cookies to when we're done.
      */
-    data->set.cookiejar = (char *)va_arg(param, void *);
+    result = Curl_setstropt(&data->set.cookiejar, va_arg(param, char *));
 
     /*
      * Activate the cookie parser. This may or may not already
@@ -1071,7 +1300,7 @@
     /*
      * Set a custom string to use as request
      */
-    data->set.customrequest = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.customrequest, va_arg(param, char *));
 
     /* we don't set
        data->set.httpreq = HTTPREQ_CUSTOM;
@@ -1137,7 +1366,7 @@
      * Setting it to NULL, means no proxy but allows the environment variables
      * to decide for us.
      */
-    data->set.proxy = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.proxy, va_arg(param, char *));
     break;
 
   case CURLOPT_WRITEHEADER:
@@ -1163,7 +1392,7 @@
     /*
      * Use FTP PORT, this also specifies which IP address to use
      */
-    data->set.ftpport = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ftpport, va_arg(param, char *));
     data->set.ftp_use_port = (bool)(NULL != data->set.ftpport);
     break;
 
@@ -1247,7 +1476,7 @@
       free(data->change.url);
       data->change.url_alloc=FALSE;
     }
-    data->set.set_url = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.set_url, va_arg(param, char *));
     data->change.url = data->set.set_url;
     data->change.url_changed = TRUE;
     break;
@@ -1284,7 +1513,7 @@
     /*
      * user:password to use in the operation
      */
-    data->set.userpwd = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.userpwd, va_arg(param, char *));
     break;
   case CURLOPT_POSTQUOTE:
     /*
@@ -1325,13 +1554,13 @@
     /*
      * user:password needed to use the proxy
      */
-    data->set.proxyuserpwd = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.proxyuserpwd, va_arg(param, char *));
     break;
   case CURLOPT_RANGE:
     /*
      * What range of the file you want to transfer
      */
-    data->set.set_range = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.set_range, va_arg(param, char *));
     break;
   case CURLOPT_RESUME_FROM:
     /*
@@ -1428,31 +1657,31 @@
     /*
      * String that holds file name of the SSL certificate to use
      */
-    data->set.cert = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.cert, va_arg(param, char *));
     break;
   case CURLOPT_SSLCERTTYPE:
     /*
      * String that holds file type of the SSL certificate to use
      */
-    data->set.cert_type = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.cert_type, va_arg(param, char *));
     break;
   case CURLOPT_SSLKEY:
     /*
      * String that holds file name of the SSL certificate to use
      */
-    data->set.key = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.key, va_arg(param, char *));
     break;
   case CURLOPT_SSLKEYTYPE:
     /*
      * String that holds file type of the SSL certificate to use
      */
-    data->set.key_type = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.key_type, va_arg(param, char *));
     break;
   case CURLOPT_SSLKEYPASSWD:
     /*
      * String that holds the SSL private key password.
      */
-    data->set.key_passwd = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.key_passwd, va_arg(param, char *));
     break;
   case CURLOPT_SSLENGINE:
     /*
@@ -1481,7 +1710,7 @@
      * Set what interface or address/hostname to bind the socket to when
      * performing an operation and thus what from-IP your connection will use.
      */
-    data->set.device = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.device, va_arg(param, char *));
     break;
   case CURLOPT_LOCALPORT:
     /*
@@ -1499,7 +1728,7 @@
     /*
      * A string that defines the kerberos security level.
      */
-    data->set.krb_level = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.krb_level, va_arg(param, char *));
     data->set.krb = (bool)(NULL != data->set.krb_level);
     break;
   case CURLOPT_SSL_VERIFYPEER:
@@ -1530,7 +1759,7 @@
     /*
      * Set CA info for SSL connection. Specify file name of the CA certificate
      */
-    data->set.ssl.CAfile = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssl.CAfile, va_arg(param, char *));
     break;
   case CURLOPT_CAPATH:
     /*
@@ -1538,7 +1767,7 @@
      * certificates which have been prepared using openssl c_rehash utility.
      */
     /* This does not work on windows. */
-    data->set.ssl.CApath = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssl.CApath, va_arg(param, char *));
     break;
   case CURLOPT_TELNETOPTIONS:
     /*
@@ -1639,7 +1868,7 @@
     /*
      * Set private data pointer.
      */
-    data->set.private_data = va_arg(param, char *);
+    data->set.private_data = va_arg(param, void *);
     break;
 
   case CURLOPT_MAXFILESIZE:
@@ -1691,7 +1920,7 @@
       These former 3rd party transfer options are deprecated */
 
   case CURLOPT_FTP_ACCOUNT:
-    data->set.ftp_account = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ftp_account, va_arg(param, char *));
     break;
 
   case CURLOPT_IGNORE_CONTENT_LENGTH:
@@ -1706,7 +1935,8 @@
     break;
 
   case CURLOPT_FTP_ALTERNATIVE_TO_USER:
-    data->set.ftp_alternative_to_user = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ftp_alternative_to_user,
+                            va_arg(param, char *));
     break;
 
   case CURLOPT_SOCKOPTFUNCTION:
@@ -1735,14 +1965,14 @@
     /*
      * Use this file instead of the $HOME/.ssh/id_dsa.pub file
      */
-    data->set.ssh_public_key = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssh_public_key, va_arg(param, char *));
     break;
 
   case CURLOPT_SSH_PRIVATE_KEYFILE:
     /*
      * Use this file instead of the $HOME/.ssh/id_dsa file
      */
-    data->set.ssh_private_key = va_arg(param, char *);
+    result = Curl_setstropt(&data->set.ssh_private_key, va_arg(param, char *));
     break;
 
   case CURLOPT_HTTP_TRANSFER_DECODING:
@@ -2945,11 +3175,8 @@
   if(urllen < LEAST_PATH_ALLOC)
     urllen=LEAST_PATH_ALLOC;
 
-  if (!data->set.source_url /* 3rd party FTP */
-      && data->reqdata.pathbuffer) {
-      /* Free the old buffer */
-      free(data->reqdata.pathbuffer);
-  }
+  /* Free the old buffer */
+  Curl_safefree(data->reqdata.pathbuffer);
 
   /*
    * We malloc() the buffers below urllen+2 to make room for to possibilities:
Index: lib/url.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/url.h,v
retrieving revision 1.33
diff -u -r1.33 url.h
--- lib/url.h	2 May 2007 19:13:56 -0000	1.33
+++ lib/url.h	29 Jul 2007 13:36:47 -0000
@@ -32,6 +32,8 @@
 CURLcode Curl_open(struct SessionHandle **curl);
 CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
                      va_list arg);
+CURLcode Curl_dupset(struct SessionHandle * dst, struct SessionHandle * src);
+void Curl_freeset(struct SessionHandle * data);
 CURLcode Curl_close(struct SessionHandle *data); /* opposite of curl_open() */
 CURLcode Curl_connect(struct SessionHandle *, struct connectdata **,
                       bool *async, bool *protocol_connect);
Index: lib/urldata.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/urldata.h,v
retrieving revision 1.339
diff -u -r1.339 urldata.h
--- lib/urldata.h	29 Jul 2007 12:54:05 -0000	1.339
+++ lib/urldata.h	29 Jul 2007 13:36:48 -0000
@@ -1237,6 +1237,7 @@
  * calculated internally for the "session handle" MUST be defined within the
  * 'struct UrlState' instead. The only exceptions MUST note the changes in
  * the 'DynamicStatic' struct.
+ * Character pointer fields point to dynamic storage, unless otherwise stated.
  */
 struct Curl_one_easy; /* declared and used only in multi.c */
 struct Curl_multi;    /* declared and used only in multi.c */
@@ -1244,7 +1245,7 @@
 struct UserDefined {
   FILE *err;         /* the stderr user data goes here */
   void *debugdata;   /* the data that will be passed to fdebug */
-  char *errorbuffer; /* store failure messages in here */
+  char *errorbuffer; /* (Static) store failure messages in here */
   char *proxyuserpwd;  /* Proxy <user:password>, if used */
   long proxyport; /* If non-zero, use this port number by default. If the
                      proxy string features a ":[port]" that one will override
@@ -1333,10 +1334,6 @@
   char *customrequest;    /* HTTP/FTP request to use */
   long httpversion; /* when non-zero, a specific HTTP version requested to
                        be used in the library's request(s) */
-  char *auth_host; /* if set, this is the allocated string to the host name
-                    * to which to send the authorization data to, and no other
-                    * host (which location-following otherwise could lead to)
-                    */
   char *krb_level;  /* what security level */
   struct ssl_config_data ssl;  /* user defined SSL stuff */
 
@@ -1345,7 +1342,7 @@
   int dns_cache_timeout; /* DNS cache timeout */
   long buffer_size;      /* size of receive buffer to use */
 
-  char *private_data; /* Private data */
+  void *private_data; /* Private data */
 
   struct Curl_one_easy *one_easy; /* When adding an easy handle to a multi
                                      handle, an internal 'Curl_one_easy'
@@ -1359,9 +1356,6 @@
 
   curl_off_t max_filesize; /* Maximum file size to download */
 
-  char *source_url;     /* for 3rd party transfer */
-  char *source_userpwd;  /* for 3rd party transfer */
-
   curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used  */
 
 /* Here follows boolean settings that define how to behave during
? docs/examples/.deps
? docs/examples/.libs
? docs/examples/10-at-a-time
? docs/examples/anyauthput
? docs/examples/cookie_interface
? docs/examples/debug
? docs/examples/fileupload
? docs/examples/fopen
? docs/examples/ftpget
? docs/examples/ftpgetresp
? docs/examples/ftpupload
? docs/examples/getinfo
? docs/examples/getinmemory
? docs/examples/http-post
? docs/examples/httpput
? docs/examples/https
? docs/examples/multi-app
? docs/examples/multi-debugcallback
? docs/examples/multi-double
? docs/examples/multi-post
? docs/examples/multi-single
? docs/examples/persistant
? docs/examples/post-callback
? docs/examples/postit2
? docs/examples/sepheaders
? docs/examples/simple
? docs/examples/simplepost
? docs/examples/simplessl
Index: docs/libcurl/curl_easy_getinfo.3
===================================================================
RCS file: /cvsroot/curl/curl/docs/libcurl/curl_easy_getinfo.3,v
retrieving revision 1.31
diff -u -r1.31 curl_easy_getinfo.3
--- docs/libcurl/curl_easy_getinfo.3	3 May 2007 19:12:45 -0000	1.31
+++ docs/libcurl/curl_easy_getinfo.3	29 Jul 2007 13:37:01 -0000
@@ -133,7 +133,9 @@
 .IP CURLINFO_PRIVATE
 Pass a pointer to a 'char *' to receive the pointer to the private data
 associated with the curl handle (set with the CURLOPT_PRIVATE option to
-\fIcurl_easy_setopt(3)\fP). (Added in 7.10.3)
+\fIcurl_easy_setopt(3)\fP). Please note that for internal reasons, the
+value is returned as a 'char *', although effectively being a 'void *'.
+(Added in 7.10.3)
 .IP CURLINFO_HTTPAUTH_AVAIL
 Pass a pointer to a long to receive a bitmask indicating the authentication
 method(s) available. The meaning of the bits is explained in the
Index: docs/libcurl/curl_easy_setopt.3
===================================================================
RCS file: /cvsroot/curl/curl/docs/libcurl/curl_easy_setopt.3,v
retrieving revision 1.190
diff -u -r1.190 curl_easy_setopt.3
--- docs/libcurl/curl_easy_setopt.3	20 Jul 2007 17:29:43 -0000	1.190
+++ docs/libcurl/curl_easy_setopt.3	29 Jul 2007 13:37:01 -0000
@@ -44,11 +44,10 @@
 you must change them between the transfers. You can optionally reset all
 options back to internal default with \fIcurl_easy_reset(3)\fP.
 
-Strings passed to libcurl as 'char *' arguments, will not be copied by the
-library. Instead you should keep them available until libcurl no longer needs
-them. Failing to do so will cause very odd behavior or even crashes. libcurl
-will need them until you call \fIcurl_easy_cleanup(3)\fP or you set the same
-option again to use a different pointer.
+Strings passed to libcurl as 'char *' arguments, are copied by the library;
+thus the string storage associated to the pointer argument may be overwritten
+after curl_easy_setopt() returns. Exceptions to this rule are described in
+the option details below.
 
 The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
 \fIcurl_easy_duphandle(3)\fP call.
@@ -330,6 +329,12 @@
 Pass a char * to a buffer that the libcurl may store human readable error
 messages in. This may be more helpful than just the return code from
 \fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
+Although this argument is a 'char *', it does not describe an input string.
+Therefore the (probably undefined) contents of the buffer is NOT copied
+by the library. You should keep the associated storage available until
+libcurl no longer needs it. Failing to do so will cause very odd behavior
+or even crashes. libcurl will need it until you call \fIcurl_easy_cleanup(3)\fP
+or you set the same option again to use a different pointer. 
 
 Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
 debug/trace why errors happen.
@@ -1397,7 +1402,7 @@
 (Added in 7.16.1)
 .SH OTHER OPTIONS
 .IP CURLOPT_PRIVATE
-Pass a char * as parameter, pointing to data that should be associated with
+Pass a void * as parameter, pointing to data that should be associated with
 this curl handle.  The pointer can subsequently be retrieved using
 \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself
 does nothing with this data. (Added in 7.10.3)
