mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:03:43 +03:00
- Mike Crowe pointed out that setting CURLOPT_USERPWD to NULL used to clear
the auth credentials back in 7.19.0 and earlier while now you have to set "" to get the same effect. His patch brings back the ability to use NULL.
This commit is contained in:
parent
eecb713616
commit
bf07d37737
3 changed files with 15 additions and 3 deletions
10
lib/url.c
10
lib/url.c
|
|
@ -275,8 +275,14 @@ static CURLcode setstropt_userpwd(char *option, char **user_storage,
|
|||
char* separator;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
if(!option)
|
||||
return result;
|
||||
if(!option) {
|
||||
/* we treat a NULL passed in as a hint to clear existing info */
|
||||
Curl_safefree(*user_storage);
|
||||
*user_storage = (char *) NULL;
|
||||
Curl_safefree(*pwd_storage);
|
||||
*pwd_storage = (char *) NULL;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
separator = strchr(option, ':');
|
||||
if (separator != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue