mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
tool: follow-up getenv fix
Remove a double free. Change the IPFS env use to a plain getenv() simply
because coverity gets confused.
Follow-up to 9126b141c9
Closes #13241
This commit is contained in:
parent
6a43d0d742
commit
aba8043075
@ -78,12 +78,10 @@ static char *ipfs_gateway(void)
|
|||||||
ipfs_path = curl_getenv("IPFS_PATH");
|
ipfs_path = curl_getenv("IPFS_PATH");
|
||||||
|
|
||||||
if(!ipfs_path) {
|
if(!ipfs_path) {
|
||||||
char *home = curl_getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
if(home && *home)
|
if(home && *home)
|
||||||
ipfs_path = aprintf("%s/.ipfs/", home);
|
ipfs_path = aprintf("%s/.ipfs/", home);
|
||||||
/* fallback to "~/.ipfs", as that's the default location. */
|
/* fallback to "~/.ipfs", as that's the default location. */
|
||||||
|
|
||||||
curl_free(home);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ipfs_path || ensure_trailing_slash(&ipfs_path))
|
if(!ipfs_path || ensure_trailing_slash(&ipfs_path))
|
||||||
|
@ -2605,7 +2605,6 @@ static CURLcode transfer_per_config(struct GlobalConfig *global,
|
|||||||
errorf(global, "out of memory");
|
errorf(global, "out of memory");
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
curl_free(env);
|
|
||||||
capath_from_env = true;
|
capath_from_env = true;
|
||||||
}
|
}
|
||||||
env = curl_getenv("SSL_CERT_FILE");
|
env = curl_getenv("SSL_CERT_FILE");
|
||||||
|
Loading…
Reference in New Issue
Block a user