mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-26 03:13:35 -05: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
1 changed files with 17 additions and 0 deletions
|
|
@ -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…
Reference in a new issue