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:
Daniel Stenberg 2024-03-30 23:42:48 +01:00
parent 6a43d0d742
commit aba8043075
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 1 additions and 4 deletions

View File

@ -78,12 +78,10 @@ static char *ipfs_gateway(void)
ipfs_path = curl_getenv("IPFS_PATH");
if(!ipfs_path) {
char *home = curl_getenv("HOME");
char *home = getenv("HOME");
if(home && *home)
ipfs_path = aprintf("%s/.ipfs/", home);
/* fallback to "~/.ipfs", as that's the default location. */
curl_free(home);
}
if(!ipfs_path || ensure_trailing_slash(&ipfs_path))

View File

@ -2605,7 +2605,6 @@ static CURLcode transfer_per_config(struct GlobalConfig *global,
errorf(global, "out of memory");
return CURLE_OUT_OF_MEMORY;
}
curl_free(env);
capath_from_env = true;
}
env = curl_getenv("SSL_CERT_FILE");