From: Daniel Stenberg Date: Sat, 30 Mar 2024 22:42:48 +0000 (+0100) Subject: tool: follow-up getenv fix X-Git-Tag: curl-8_8_0~327 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aba8043075f6df09e489379f19f99cbc377b25d4;p=thirdparty%2Fcurl.git 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 9126b141c9398fe Closes #13241 --- diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index f2d26d2747..8e4f3b7eaa 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -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)) diff --git a/src/tool_operate.c b/src/tool_operate.c index 80106a6913..49ec7d835c 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -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");