]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cfgcond: revisit the condition freeing mechanism to avoid a leak
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Jul 2021 16:46:30 +0000 (18:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 17 Jul 2021 16:46:30 +0000 (18:46 +0200)
commitf1db20c473e1c5bfb20a8613325675d178499f84
tree907c460ef4ad92ef029750fc09f839c9b549824d
parent69a23ae0917750329fa5e6072f5cb9b68b949bdd
BUG/MINOR: cfgcond: revisit the condition freeing mechanism to avoid a leak

The cfg_free_cond_{term,and,expr}() functions used to take a pointer to
the pointer to be freed in order to replace it with a NULL once done.
But this doesn't cope well with freeing lists as it would require
recursion which the current code tried to avoid.

Let's just change the API to free the area and let the caller set the NULL.

This leak was reported by oss-fuzz (issue 36265).
include/haproxy/cfgcond.h
src/cfgcond.c