mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
MINOR: httpclient: destroy() must free the headers and the ists
httpclient_destroy() must free all the ist in the httpclient structure, the URL in the request, the vsn and reason in the response. It also must free the list of headers of the response.
This commit is contained in:
parent
d34758849e
commit
03f5a1c77d
@ -410,10 +410,27 @@ out:
|
||||
/* Free the httpclient */
|
||||
void httpclient_destroy(struct httpclient *hc)
|
||||
{
|
||||
struct http_hdr *hdrs;
|
||||
|
||||
|
||||
if (!hc)
|
||||
return;
|
||||
/* request */
|
||||
istfree(&hc->req.url);
|
||||
b_free(&hc->req.buf);
|
||||
/* response */
|
||||
istfree(&hc->res.vsn);
|
||||
istfree(&hc->res.reason);
|
||||
hdrs = hc->res.hdrs;
|
||||
while (hdrs && isttest(hdrs->n)) {
|
||||
istfree(&hdrs->n);
|
||||
istfree(&hdrs->v);
|
||||
hdrs++;
|
||||
}
|
||||
ha_free(&hc->res.hdrs);
|
||||
b_free(&hc->res.buf);
|
||||
|
||||
|
||||
free(hc);
|
||||
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user