mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-10 09:02:43 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user