]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: converters: Store the sink in an arg pointer for debug() converter
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 Aug 2020 12:00:23 +0000 (14:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 Aug 2020 12:24:21 +0000 (14:24 +0200)
commitb45bf8eb70789264b9fd38fd6c1bc1c1c723ffe3
tree76e3046f2ab661415b5476382dee88c6b85fb928
parente02fc4d0dd57c92bbe96f3ff2ae0b890405458f2
BUG/MINOR: converters: Store the sink in an arg pointer for debug() converter

The debug() converter uses a string to reference the sink where to send debug
events. During the configuration parsing, this string is converted to a sink
object but it is still store as a string argument. It is a problem on deinit
because string arguments are released. So the sink pointer will be released
twice.

To fix the bug, we keep a reference on the sink using an ARGT_PTR argument. This
way, it will not be freed on the deinit.

This patch depends on the commit e02fc4d0d ("MINOR: arg: Add an argument type to
keep a reference on opaque data"). Both must be backported as far as 2.1.
src/sample.c