http_proxy: restore the protocol pointer on error

Reported-by: Trail of Bits

Closes #9790
This commit is contained in:
Daniel Stenberg 2022-10-06 14:13:36 +02:00
parent 9d0869d234
commit 55e1875729
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 2 additions and 13 deletions

View file

@ -212,10 +212,8 @@ void Curl_connect_done(struct Curl_easy *data)
Curl_dyn_free(&s->rcvbuf);
Curl_dyn_free(&s->req);
/* restore the protocol pointer, if not already done */
if(s->prot_save)
data->req.p.http = s->prot_save;
s->prot_save = NULL;
/* restore the protocol pointer */
data->req.p.http = s->prot_save;
data->info.httpcode = 0; /* clear it as it might've been used for the
proxy */
data->req.ignorebody = FALSE;