]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: proxy: add proxy_free_common() helper function
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 10 Jun 2024 17:31:19 +0000 (19:31 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 11 Jun 2024 08:59:45 +0000 (10:59 +0200)
commit005e4ba715cf54204ea2fc752ba4d44a23eb61bd
treee9e414e2ce5ba1fd83f1b022ca4babecbb3d235b
parent847c406b9a040193c374daad3269d646dda7dbcc
MINOR: proxy: add proxy_free_common() helper function

As shown by previous patch series, having to free some common proxy
struct members twice (in free_proxy() and proxy_free_defaults()) is
error-prone: we often overlook one of the two free locations when
adding new features.

To prevent such bugs from being introduced in the future, and also avoid
code duplication, we now have a proxy_free_common() function to free all
proxy struct members that are common to all proxy types (either regular or
default ones).

This should greatly improve code maintenance related to proxy freeing
logic.
src/proxy.c