MINOR: pattern: add pat_ref_free() helper func
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Nov 2024 09:11:17 +0000 (10:11 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Nov 2024 10:36:13 +0000 (11:36 +0100)
commitaba3ed62ae98ede29cad5708ab89c6aa37772778
tree49b55ab616ddd2b9d1758ae7a98746671f08afcc
parente8a0dbff93bf6e2b7264d4b34c37a6d287060e63
MINOR: pattern: add pat_ref_free() helper func

For now, pat_ref struct are never freed, except during init in case of
error. The freeing is done directly in the init functions because we
don't have an helper for that.

No having an helper func to properly free pat_ref struct doesn't encourage
us to free unused pat_ref structs, plus it is error-prone if new dynamic
members are added to pat_ref struct in the future.

To fix that, let's add a pat_ref_free() helper func and use it where
relevant (which means only under pat_ref init function for now..)
src/pattern.c