cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Support socks proxy specification in "all_proxy" variable

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 28 Apr 2011 08:38:05 +0200 (CEST)

On Wed, 27 Apr 2011, Dan Fandrich wrote:

>> + result = parse_proxy(data, conn, proxy);
>> + /* parse_proxy has freed the proxy string, so don't try to use it again */
>
> This part doesn't look right. The original code (below) had a proxy=NULL
> line here because proxy has been freed by this point. This comment no longer
> makes sense without that.

Well, actually it does. The code below this section still uses the proxy
pointer only as a boolean as to whether there is a proxy set or not. As it
doesn't dereference the pointer that points to freed memory, it still works.

But I agree that this is far from obvious and invites future problems. I'll
modify the code to be more straight-forward.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-04-28