cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_perform crash in Curl_do after Curl_reconnect_request has been called

From: Ho-chi Chen <junkleo_at_yahoo.com>
Date: Wed, 26 Sep 2012 15:02:32 -0700 (PDT)

> Thanks for your patience and explaining the case further. I see now how this can
> indeed be a problem. May I suggest that we simplify your suggested fix and just
> add a single line? The command already warned us and the variable will be
> assigned (again) further down if things are fine for that.
>
> --- a/lib/transfer.c
> +++ b/lib/transfer.c
> @@ -1985,7 +1985,9 @@ Curl_reconnect_request(struct connectdata **connp)
>   conn->bits.close = TRUE; /* enforce close of this connection */
>   result = Curl_done(&conn, result, FALSE); /* we are so done with this */
>
> -  /* conn may no longer be a good pointer */
> +  /* conn may no longer be a good pointer, clear it to avoid mistakes by
> +    parent functions */
> +  *connp = NULL;
>
>   /*
>     * According to bug report #1330310. We need to check for CURLE_SEND_ERROR
>
>
>
> --
> / daniel.haxx.se
>
 
Yes, I think it will do since we always close the connection by setting conn->bits.close to true in this case.
Thanks,
 
Ho-chi Chen

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-27