check for failing strdup()s
This commit is contained in:
parent
da6eea9b38
commit
aca79af7de
@ -2836,6 +2836,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->proxy.name = conn->proxy.rawalloc;
|
conn->proxy.name = conn->proxy.rawalloc;
|
||||||
|
|
||||||
free(proxydup); /* free the duplicate pointer and not the modified */
|
free(proxydup); /* free the duplicate pointer and not the modified */
|
||||||
|
if(!conn->proxy.rawalloc)
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
@ -2964,7 +2966,6 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
|
|
||||||
conn->user = strdup(CURL_DEFAULT_USER);
|
conn->user = strdup(CURL_DEFAULT_USER);
|
||||||
conn->passwd = strdup(CURL_DEFAULT_PASSWORD);
|
conn->passwd = strdup(CURL_DEFAULT_PASSWORD);
|
||||||
|
|
||||||
/* This is the default password, so DON'T set conn->bits.user_passwd */
|
/* This is the default password, so DON'T set conn->bits.user_passwd */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2972,6 +2973,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
conn->user = strdup(user);
|
conn->user = strdup(user);
|
||||||
conn->passwd = strdup(passwd);
|
conn->passwd = strdup(passwd);
|
||||||
}
|
}
|
||||||
|
if(!conn->user || !conn->passwd)
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* Check the current list of connections to see if we can
|
* Check the current list of connections to see if we can
|
||||||
|
Loading…
x
Reference in New Issue
Block a user