From: Daniel Stenberg Date: Wed, 6 Apr 2022 06:32:03 +0000 (+0200) Subject: connecache: remove duplicate connc->closure_handle check X-Git-Tag: curl-7_83_0~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4cf98bbd190773cd2299bc057ae60fe01f415ec;p=thirdparty%2Fcurl.git connecache: remove duplicate connc->closure_handle check The superfluous extra check could cause analyzer false positives and doesn't serve any purpose. Closes #8676 --- diff --git a/lib/conncache.c b/lib/conncache.c index cd5756ae40..ec669b971d 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -531,6 +531,7 @@ void Curl_conncache_close_all_connections(struct conncache *connc) { struct connectdata *conn; char buffer[READBUFFER_MIN + 1]; + SIGPIPE_VARIABLE(pipe_st); if(!connc->closure_handle) return; connc->closure_handle->state.buffer = buffer; @@ -538,7 +539,6 @@ void Curl_conncache_close_all_connections(struct conncache *connc) conn = conncache_find_first_connection(connc); while(conn) { - SIGPIPE_VARIABLE(pipe_st); sigpipe_ignore(connc->closure_handle, &pipe_st); /* This will remove the connection from the cache */ connclose(conn, "kill all"); @@ -550,15 +550,12 @@ void Curl_conncache_close_all_connections(struct conncache *connc) } connc->closure_handle->state.buffer = NULL; - if(connc->closure_handle) { - SIGPIPE_VARIABLE(pipe_st); - sigpipe_ignore(connc->closure_handle, &pipe_st); + sigpipe_ignore(connc->closure_handle, &pipe_st); - Curl_hostcache_clean(connc->closure_handle, - connc->closure_handle->dns.hostcache); - Curl_close(&connc->closure_handle); - sigpipe_restore(&pipe_st); - } + Curl_hostcache_clean(connc->closure_handle, + connc->closure_handle->dns.hostcache); + Curl_close(&connc->closure_handle); + sigpipe_restore(&pipe_st); } #if 0