MINOR: proxy: add http_free_redirect_rule() function

Adding http_free_redirect_rule() function to free a single redirect rule
since it may be required to free rules outside of free_proxy() function.

This patch is required for an upcoming bugfix.

[for 2.2, free_proxy function did not exist (first seen in 2.4), thus
http_free_redirect_rule() needs to be deducted from haproxy.c deinit()
function if the patch is required]

(cherry picked from commit 7abc9224a69eb5f1b592336044257b38823a8fe3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0798a1559860a5cd98850cd38ed5987d2968114f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 29d78dc396d7ca3157fd2b7f386c0e21c0497039)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/http_rules.c b/src/http_rules.c
index 1b21133..9de91a2 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -301,6 +301,26 @@
 	return NULL;
 }
 
+/* completely free redirect rule */
+void http_free_redirect_rule(struct redirect_rule *rdr)
+{
+	struct logformat_node *lf, *lfb;
+
+	if (rdr->cond) {
+		prune_acl_cond(rdr->cond);
+		free(rdr->cond);
+	}
+	free(rdr->rdr_str);
+	free(rdr->cookie_str);
+	list_for_each_entry_safe(lf, lfb, &rdr->rdr_fmt, list) {
+		LIST_DELETE(&lf->list);
+		release_sample_expr(lf->expr);
+		free(lf->arg);
+		free(lf);
+	}
+	free(rdr);
+}
+
 /* Parses a redirect rule. Returns the redirect rule on success or NULL on error,
  * with <err> filled with the error message. If <use_fmt> is not null, builds a
  * dynamic log-format rule instead of a static string. Parameter <dir> indicates