]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cfilters: make Curl_conn_connect always assign 'done'
authorDaniel Stenberg <daniel@haxx.se>
Wed, 5 Jun 2024 06:31:11 +0000 (08:31 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 5 Jun 2024 06:51:14 +0000 (08:51 +0200)
It could return error without assigning it, and we have a caller in
multi.c that assumes it gets set.

Spotted by CodeSonar
Closes #13884

lib/cfilters.c

index a1e405bc5e88bb07ce7ac5259aa51b2c3bfbbd21..60767aa38902d6702edc9e6eff017d68695fd919 100644 (file)
@@ -345,8 +345,10 @@ CURLcode Curl_conn_connect(struct Curl_easy *data,
 
   cf = data->conn->cfilter[sockindex];
   DEBUGASSERT(cf);
-  if(!cf)
+  if(!cf) {
+    *done = FALSE;
     return CURLE_FAILED_INIT;
+  }
 
   *done = cf->connected;
   if(!*done) {