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.
This commit is contained in:
Daniel Stenberg
2007-08-01 21:20:01 +00:00
parent 006878686c
commit 50c10aa5bf
21 changed files with 364 additions and 218 deletions

View File

@@ -225,8 +225,8 @@ static char * nss_get_password(PK11SlotInfo * slot, PRBool retry, void *arg)
pphrase_arg_t *parg = (pphrase_arg_t *) arg;
(void)slot; /* unused */
(void)retry; /* unused */
if(parg->data->set.key_passwd)
return (char *)PORT_Strdup((char *)parg->data->set.key_passwd);
if(parg->data->set.str[STRING_KEY_PASSWD])
return (char *)PORT_Strdup((char *)parg->data->set.str[STRING_KEY_PASSWD]);
else
return NULL;
}
@@ -488,10 +488,11 @@ CURLcode Curl_nss_connect(struct connectdata * conn, int sockindex)
NULL) != SECSuccess)
goto error;
if(data->set.cert) {
if(data->set.str[STRING_CERT]) {
if(SSL_GetClientAuthDataHook(model,
(SSLGetClientAuthData) SelectClientCert,
(void *)data->set.cert) != SECSuccess) {
(void *)data->set.str[STRING_CERT]) !=
SECSuccess) {
curlerr = CURLE_SSL_CERTPROBLEM;
goto error;
}