cf-h1-proxy: skip an extra NULL assign

and use Curl_safefree() once to save another NULL assign. Found by PVS.

Ref. #10929
Closes #10953
This commit is contained in:
Daniel Stenberg 2023-04-13 12:50:04 +02:00
parent 314dc407d6
commit aabfa60371
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -215,7 +215,6 @@ static void tunnel_go_state(struct Curl_cfilter *cf,
make sure that it isn't accidentally used for the document request make sure that it isn't accidentally used for the document request
after we've connected. So let's free and clear it here. */ after we've connected. So let's free and clear it here. */
Curl_safefree(data->state.aptr.proxyuserpwd); Curl_safefree(data->state.aptr.proxyuserpwd);
data->state.aptr.proxyuserpwd = NULL;
#ifdef USE_HYPER #ifdef USE_HYPER
data->state.hconnect = FALSE; data->state.hconnect = FALSE;
#endif #endif
@ -1043,8 +1042,7 @@ static CURLcode CONNECT(struct Curl_cfilter *cf,
DEBUGASSERT(ts->tunnel_state == TUNNEL_RESPONSE); DEBUGASSERT(ts->tunnel_state == TUNNEL_RESPONSE);
if(data->info.httpproxycode/100 != 2) { if(data->info.httpproxycode/100 != 2) {
/* a non-2xx response and we have no next url to try. */ /* a non-2xx response and we have no next url to try. */
free(data->req.newurl); Curl_safefree(data->req.newurl);
data->req.newurl = NULL;
/* failure, close this connection to avoid re-use */ /* failure, close this connection to avoid re-use */
streamclose(conn, "proxy CONNECT failure"); streamclose(conn, "proxy CONNECT failure");
tunnel_go_state(cf, ts, TUNNEL_FAILED, data); tunnel_go_state(cf, ts, TUNNEL_FAILED, data);