mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
MINOR: dns: Add function to release memory allocated for a do-resolve rule
Memory allocated when a do-resolve rule is parsed is now released when HAProxy exits.
This commit is contained in:
parent
a4168434a7
commit
3b2bb63ded
@ -2482,6 +2482,14 @@ enum act_return dns_action_do_resolve(struct act_rule *rule, struct proxy *px,
|
||||
return ACT_RET_YIELD;
|
||||
}
|
||||
|
||||
static void release_dns_action(struct act_rule *rule)
|
||||
{
|
||||
release_sample_expr(rule->arg.dns.expr);
|
||||
free(rule->arg.dns.varname);
|
||||
free(rule->arg.dns.resolvers_id);
|
||||
free(rule->arg.dns.dns_opts);
|
||||
}
|
||||
|
||||
|
||||
/* parse "do-resolve" action
|
||||
* This action takes the following arguments:
|
||||
@ -2588,6 +2596,7 @@ enum act_parse_ret dns_parse_do_resolve(const char **args, int *orig_arg, struct
|
||||
*orig_arg = cur_arg;
|
||||
|
||||
rule->check_ptr = check_action_do_resolve;
|
||||
rule->release_ptr = release_dns_action;
|
||||
|
||||
return ACT_RET_PRS_OK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user