]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls_scache: avoid a "Redundant Condition"
authorDaniel Stenberg <daniel@haxx.se>
Thu, 9 Jan 2025 07:20:22 +0000 (08:20 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Jan 2025 16:23:26 +0000 (17:23 +0100)
Pointed out by CodeSonar. "ssl_config" can in fact not be NULL here.
Made it an assert instead.

Closes #15948

lib/vtls/vtls_scache.c

index 5f4ec4604b74eec9c362297fca6eb95004c0754b..937cb8c87ec0e235c17997d1097ec2a3cfa54bf8 100644 (file)
@@ -795,8 +795,9 @@ CURLcode Curl_ssl_scache_put(struct Curl_cfilter *cf,
   struct Curl_ssl_scache *scache = data->state.ssl_scache;
   struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
   CURLcode result;
+  DEBUGASSERT(ssl_config);
 
-  if(!ssl_config || !scache || !ssl_config->primary.cache_session) {
+  if(!scache || !ssl_config->primary.cache_session) {
     Curl_ssl_session_destroy(s);
     return CURLE_OK;
   }