mirror of
https://github.com/curl/curl.git
synced 2026-05-01 11:37:54 +03:00
urlapi: make curl_url_set(url, CURLUPART_URL, NULL, 0) clear all parts
As per the documentation : > Setting a part to a NULL pointer will effectively remove that > part's contents from the CURLU handle. But currently clearing CURLUPART_URL does nothing and returns CURLUE_OK. This change will clear all parts of the URL at once. Closes #9028
This commit is contained in:
parent
06fc958305
commit
4bf2c231d7
2 changed files with 62 additions and 0 deletions
|
|
@ -1518,6 +1518,10 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
|
|||
if(storep && *storep) {
|
||||
Curl_safefree(*storep);
|
||||
}
|
||||
else if(!storep) {
|
||||
free_urlhandle(u);
|
||||
memset(u, 0, sizeof(struct Curl_URL));
|
||||
}
|
||||
return CURLUE_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue