]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cfilters: check for NULL before using pointer
authorDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jan 2023 11:48:56 +0000 (12:48 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jan 2023 12:18:58 +0000 (13:18 +0100)
Detected by Coverity CID 1518343

Closes #10202

lib/cfilters.c

index 6408e0bc5ef1691400af78fb9e426a1049dce1d5..3e68b99d74cc6ad3ffa86ed21575d6e1201e15c9 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2023, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -605,7 +605,7 @@ void Curl_conn_ev_update_info(struct Curl_easy *data,
 bool Curl_conn_is_alive(struct Curl_easy *data, struct connectdata *conn)
 {
   struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET];
-  return !cf->conn->bits.close && cf && cf->cft->is_alive(cf, data);
+  return cf && !cf->conn->bits.close && cf->cft->is_alive(cf, data);
 }
 
 CURLcode Curl_conn_keep_alive(struct Curl_easy *data,