summaryrefslogtreecommitdiff
path: root/lib/cf-h1-proxy.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-04-13 12:50:04 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-13 17:23:50 +0200
commitaabfa60371012efb39276c463db26016e89b5a10 (patch)
tree653061a6d5c2447736cd5c97532326d8f0dbc72f /lib/cf-h1-proxy.c
parent314dc407d69bda82a467340bd4a56abaee76715f (diff)
downloadcurl-aabfa60371012efb39276c463db26016e89b5a10.tar.gz
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
Diffstat (limited to 'lib/cf-h1-proxy.c')
-rw-r--r--lib/cf-h1-proxy.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c
index a02c46a52..700c199b1 100644
--- a/lib/cf-h1-proxy.c
+++ b/lib/cf-h1-proxy.c
@@ -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
after we've connected. So let's free and clear it here. */
Curl_safefree(data->state.aptr.proxyuserpwd);
- data->state.aptr.proxyuserpwd = NULL;
#ifdef USE_HYPER
data->state.hconnect = FALSE;
#endif
@@ -1043,8 +1042,7 @@ static CURLcode CONNECT(struct Curl_cfilter *cf,
DEBUGASSERT(ts->tunnel_state == TUNNEL_RESPONSE);
if(data->info.httpproxycode/100 != 2) {
/* a non-2xx response and we have no next url to try. */
- free(data->req.newurl);
- data->req.newurl = NULL;
+ Curl_safefree(data->req.newurl);
/* failure, close this connection to avoid re-use */
streamclose(conn, "proxy CONNECT failure");
tunnel_go_state(cf, ts, TUNNEL_FAILED, data);