Skip to content

Commit

Permalink
detect_proxy: fix possible single-byte memory leak
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bagder committed Oct 2, 2014
1 parent 0d35715 commit b85c625
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/url.c
Expand Up @@ -4339,9 +4339,8 @@ static char *detect_proxy(struct connectdata *conn)
prox=curl_getenv(proxy_env);
}

if(prox && *prox) { /* don't count "" strings */
if(prox)
proxy = prox; /* use this */
}
else {
proxy = curl_getenv("all_proxy"); /* default proxy to use */
if(!proxy)
Expand Down

0 comments on commit b85c625

Please sign in to comment.