mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
netrc: Fixed a memory leak in an OOM condition
This commit is contained in:
parent
97857de80e
commit
768151449b
@ -4805,13 +4805,17 @@ static CURLcode override_login(struct SessionHandle *data,
|
||||
|
||||
conn->bits.netrc = FALSE;
|
||||
if(data->set.use_netrc != CURL_NETRC_IGNORED) {
|
||||
if(Curl_parsenetrc(conn->host.name,
|
||||
int ret = Curl_parsenetrc(conn->host.name,
|
||||
userp, passwdp,
|
||||
data->set.str[STRING_NETRC_FILE])) {
|
||||
data->set.str[STRING_NETRC_FILE]);
|
||||
if(ret > 0) {
|
||||
infof(data, "Couldn't find host %s in the "
|
||||
DOT_CHAR "netrc file; using defaults\n",
|
||||
conn->host.name);
|
||||
}
|
||||
else if(ret < 0 ) {
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
else {
|
||||
/* set bits.netrc TRUE to remember that we got the name from a .netrc
|
||||
file, so that it is safe to use even if we followed a Location: to a
|
||||
|
Loading…
Reference in New Issue
Block a user