mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
tool_operate: free 'gateway' correctly
Pointed out by Coverity. The fix in 93885cf3a8
was incomplete.
Also removed repeated wording in IPFS related error messages.
Closes #11969
This commit is contained in:
parent
0bd9e137e3
commit
a35e2dd69c
@ -857,34 +857,29 @@ static CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
|
||||
result = CURLE_OK;
|
||||
|
||||
clean:
|
||||
curl_free(gateway);
|
||||
free(gateway);
|
||||
curl_free(cid);
|
||||
curl_free(pathbuffer);
|
||||
|
||||
if(ipfsurl) {
|
||||
curl_url_cleanup(ipfsurl);
|
||||
}
|
||||
curl_url_cleanup(ipfsurl);
|
||||
|
||||
switch(result) {
|
||||
case CURLE_URL_MALFORMAT:
|
||||
helpf(stderr, "malformed URL. Visit https://curl.se/"
|
||||
"docs/ipfs.html#Gateway-file-and-"
|
||||
"environment-variable for more "
|
||||
"information for more information");
|
||||
"information");
|
||||
break;
|
||||
case CURLE_FILE_COULDNT_READ_FILE:
|
||||
helpf(stderr, "IPFS automatic gateway detection "
|
||||
"failure. Visit https://curl.se/docs/"
|
||||
"ipfs.html#Malformed-gateway-URL for "
|
||||
"more information for more "
|
||||
"information");
|
||||
"more information");
|
||||
break;
|
||||
case CURLE_BAD_FUNCTION_ARGUMENT:
|
||||
helpf(stderr, "--ipfs-gateway argument results in "
|
||||
"malformed URL. Visit https://curl.se/"
|
||||
"docs/ipfs.html#Malformed-gateway-URL "
|
||||
"for more information for more "
|
||||
"information");
|
||||
"for more information");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user