mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
CLEANUP: http_act: use http_free_redirect_rule() to clean redirect act
Since redirect rules now have a dedicated cleanup function, better use it to prevent code duplication.
This commit is contained in:
parent
5313570605
commit
cd9aff1321
@ -1770,7 +1770,6 @@ static enum act_parse_ret parse_http_del_header(const char **args, int *orig_arg
|
|||||||
/* Release memory allocated by an http redirect action. */
|
/* Release memory allocated by an http redirect action. */
|
||||||
static void release_http_redir(struct act_rule *rule)
|
static void release_http_redir(struct act_rule *rule)
|
||||||
{
|
{
|
||||||
struct logformat_node *lf, *lfb;
|
|
||||||
struct redirect_rule *redir;
|
struct redirect_rule *redir;
|
||||||
|
|
||||||
redir = rule->arg.redir;
|
redir = rule->arg.redir;
|
||||||
@ -1778,19 +1777,7 @@ static void release_http_redir(struct act_rule *rule)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
LIST_DELETE(&redir->list);
|
LIST_DELETE(&redir->list);
|
||||||
if (redir->cond) {
|
http_free_redirect_rule(redir);
|
||||||
prune_acl_cond(redir->cond);
|
|
||||||
free(redir->cond);
|
|
||||||
}
|
|
||||||
free(redir->rdr_str);
|
|
||||||
free(redir->cookie_str);
|
|
||||||
list_for_each_entry_safe(lf, lfb, &redir->rdr_fmt, list) {
|
|
||||||
LIST_DELETE(&lf->list);
|
|
||||||
release_sample_expr(lf->expr);
|
|
||||||
free(lf->arg);
|
|
||||||
free(lf);
|
|
||||||
}
|
|
||||||
free(redir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse a "redirect" action. It returns ACT_RET_PRS_OK on success,
|
/* Parse a "redirect" action. It returns ACT_RET_PRS_OK on success,
|
||||||
|
Loading…
Reference in New Issue
Block a user