aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-04-20 19:10:10 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-04-20 19:10:10 +0100
commite99c81a07c0c8752a286e0f14174ae7ae114090c (patch)
tree72308e2816d5d29622cc988945b93bd2fb119949
parentfe880475ed3c7e51e32e19112252c79e921cc31b (diff)
url: Correction to scope of if statements when setting data
-rw-r--r--lib/url.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 7b1237289..4f995ab54 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -332,19 +332,22 @@ static CURLcode setstropt_userpwd(char *option, char **user_storage,
(options_storage ? &optionsp : NULL));
if(!result) {
/* store username part of option */
- if(user_storage)
+ if(user_storage) {
Curl_safefree(*user_storage);
*user_storage = userp;
+ }
/* store password part of option */
- if(pwd_storage)
+ if(pwd_storage) {
Curl_safefree(*pwd_storage);
*pwd_storage = passwdp;
+ }
/* store options part of option */
- if(options_storage)
+ if(options_storage) {
Curl_safefree(*options_storage);
*options_storage = optionsp;
+ }
}
return result;