mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
detect_proxy: fix possible single-byte memory leak
Coverity CID 1202836. If the proxy environment variable returned an empty string, it would be leaked. While an empty string is not really a proxy, other logic in this function already allows a blank string to be returned so allow that here to avoid the leak.
This commit is contained in:
parent
0d357155cc
commit
b85c625d83
@ -4339,9 +4339,8 @@ static char *detect_proxy(struct connectdata *conn)
|
|||||||
prox=curl_getenv(proxy_env);
|
prox=curl_getenv(proxy_env);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(prox && *prox) { /* don't count "" strings */
|
if(prox)
|
||||||
proxy = prox; /* use this */
|
proxy = prox; /* use this */
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
proxy = curl_getenv("all_proxy"); /* default proxy to use */
|
proxy = curl_getenv("all_proxy"); /* default proxy to use */
|
||||||
if(!proxy)
|
if(!proxy)
|
||||||
|
Loading…
Reference in New Issue
Block a user