mirror of
https://github.com/curl/curl.git
synced 2026-07-31 21:18:04 +03:00
url.c: fix parse_login_details() OOM handling
This commit is contained in:
parent
65d53cf6ef
commit
83f0dae129
1 changed files with 7 additions and 2 deletions
|
|
@ -4565,15 +4565,20 @@ static CURLcode parse_login_details(const char *login, const size_t len,
|
|||
/* Allocate the password portion buffer */
|
||||
if(!result && passwdp && plen) {
|
||||
pbuf = malloc(plen + 1);
|
||||
if(!pbuf)
|
||||
if(!pbuf) {
|
||||
Curl_safefree(ubuf);
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate the options portion buffer */
|
||||
if(!result && optionsp && olen) {
|
||||
obuf = malloc(olen + 1);
|
||||
if(!obuf)
|
||||
if(!obuf) {
|
||||
Curl_safefree(pbuf);
|
||||
Curl_safefree(ubuf);
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
if(!result) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue