aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-05-27 21:45:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-05-27 21:45:12 +0000
commitbf07d37737e179ff2ded90b8303bb65c227a8615 (patch)
tree3e0f2f359ee8e0efce5925b773d404fe3d2ac580 /lib
parenteecb7136164ac60567c28b2386e291106aaee1de (diff)
- 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.
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 88f797296..a97176495 100644
--- a/lib/url.c
+++ b/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) {