mirror of
https://github.com/curl/curl.git
synced 2026-08-26 01:13:37 +03:00
OOM handling/cleanup slight adjustments
This commit is contained in:
parent
584dc8b8af
commit
bff78cc18e
5 changed files with 50 additions and 32 deletions
|
|
@ -1912,8 +1912,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||
memcpy(newurl + newlen + (ptr - url),
|
||||
ptr + currlen, /* copy the trailing zero byte too */
|
||||
urllen - (ptr-url) - currlen + 1);
|
||||
if(data->change.url_alloc)
|
||||
free(data->change.url);
|
||||
if(data->change.url_alloc) {
|
||||
Curl_safefree(data->change.url);
|
||||
data->change.url_alloc = FALSE;
|
||||
}
|
||||
data->change.url = newurl;
|
||||
data->change.url_alloc = TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue