From: Daniel Stenberg Date: Thu, 9 Jan 2025 07:20:22 +0000 (+0100) Subject: vtls_scache: avoid a "Redundant Condition" X-Git-Tag: curl-8_12_0~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0607b27b0213682919a4f2d685d638811d08e2f;p=thirdparty%2Fcurl.git vtls_scache: avoid a "Redundant Condition" Pointed out by CodeSonar. "ssl_config" can in fact not be NULL here. Made it an assert instead. Closes #15948 --- diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 5f4ec4604b..937cb8c87e 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -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; }