diff --git a/lib/url.c b/lib/url.c index abbcafa044..03a0b6edd6 100644 --- a/lib/url.c +++ b/lib/url.c @@ -564,9 +564,10 @@ CURLcode Curl_open(struct SessionHandle **curl) free(data); data = NULL; } + else + *curl = data; - *curl = data; - return CURLE_OK; + return res; } CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,