]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: ensure that unresolved arguments are freed exactly once
authorWilly Tarreau <w@1wt.eu>
Fri, 1 Jun 2012 08:38:29 +0000 (10:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jun 2012 08:40:52 +0000 (10:40 +0200)
commit496aa0111ee22d0deb8ca0c30c85503011219f05
tree85e81b0cbfdf8162970ebf7113179ce9c2ffb741
parent4992dd2d307aefd288379d2fefcf5a87b7631b75
BUG/MEDIUM: ensure that unresolved arguments are freed exactly once

When passing arguments to ACLs and samples, some types are stored as
strings then resolved later after config parsing is done. Upon exit,
the arguments need to be freed only if the string was not resolved
yet. At the moment we can encounter double free during deinit()
because some arguments (eg: userlists) are freed once as their own
type and once as a string.

The solution consists in adding an "unresolved" flag to the args to
say whether the value is still held in the <str> part or is final.

This could be debugged thanks to a useful bug report from Sander Klein.
include/types/arg.h
src/acl.c
src/arg.c
src/haproxy.c