]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua/httpclient: missing free in hlua_httpclient_send()
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 9 Feb 2023 14:26:25 +0000 (15:26 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 22 Feb 2023 10:29:59 +0000 (11:29 +0100)
commit035640733251b7b8ce0df80f5d7429c3cb19d8f9
treed49ab33fe902096eb2f49a357be36706e4d30c8f
parent27629a7d65915361b88b1500d2470114cd0c3dd6
BUG/MINOR: lua/httpclient: missing free in hlua_httpclient_send()

In hlua_httpclient_send(), we replace hc->req.url with a new url.
But we forgot to free the original url that was allocated in
hlua_httpclient_new() or in the previous httpclient_send() call.

Because of this, each httpclient request performed under lua scripts would
result in a small leak. When stress-testing a lua action which uses httpclient,
the leak is clearly visible since we're leaking severals Mbytes per minute.

This bug was discovered by chance when trying to reproduce GH issue #2037.

It must be backported up to 2.5
src/hlua.c