diff options
author | Aurelien DARRAGON <adarragon@haproxy.com> | 2023-05-11 12:42:24 +0200 |
---|---|---|
committer | Christopher Faulet <cfaulet@haproxy.com> | 2023-05-11 15:37:04 +0200 |
commit | cd9aff13214d26ddcccc0aef9494f3fbfdb5217b (patch) | |
tree | 0f47ddf86ffb720002bbfcd005f631ef3cddb1dd | |
parent | 5313570605fdcf471e7286a68432830a2a1ca72f (diff) | |
download | haproxy-cd9aff13214d26ddcccc0aef9494f3fbfdb5217b.tar.gz |
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.
-rw-r--r-- | src/http_act.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/http_act.c b/src/http_act.c index c14ccc6da..2505ad212 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -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. */ static void release_http_redir(struct act_rule *rule) { - struct logformat_node *lf, *lfb; struct redirect_rule *redir; redir = rule->arg.redir; @@ -1778,19 +1777,7 @@ static void release_http_redir(struct act_rule *rule) return; LIST_DELETE(&redir->list); - if (redir->cond) { - 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); + http_free_redirect_rule(redir); } /* Parse a "redirect" action. It returns ACT_RET_PRS_OK on success, |