MINOR: actions: add new function free_act_rule() to free a single rule

There was free_act_rules() that frees all rules from a head but nothing
to free a single rule. Currently some rulesets partially free their own
rules on parsing error, and we're seeing some regtests emit errors under
ASAN because of this.

Let's first extract the code to free a rule into its own function so
that it becomes possible to use it on a single rule.
This commit is contained in:
Willy Tarreau
2022-03-17 20:23:43 +01:00
parent 211ea252d9
commit 6a783e499c
2 changed files with 13 additions and 6 deletions

View File

@@ -34,6 +34,7 @@ struct dns_counters;
int act_resolution_cb(struct resolv_requester *requester, struct dns_counters *counters);
int act_resolution_error_cb(struct resolv_requester *requester, int error_code);
const char *action_suggest(const char *word, const struct list *keywords, const char **extra);
void free_act_rule(struct act_rule *rule);
static inline struct action_kw *action_lookup(struct list *keywords, const char *kw)
{