From: Willy Tarreau Date: Thu, 30 Apr 2026 13:53:21 +0000 (+0200) Subject: CLEANUP: acl: remove duplicate test in parse_acl_expr() and unused variable X-Git-Tag: v3.4-dev11~80 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=e6b3dd7b348e4b10776f113f25a403fdc45f6861;p=haproxy.git CLEANUP: acl: remove duplicate test in parse_acl_expr() and unused variable aclkw->match_type was compared twice to PAT_MATCH_DOM in parse_acl_expr(). After auditing the involved types, it's only a copy-paste mistake, as no other matching method is missing, so let's drop it to avoid the confusion. Also drop variable ckw which is assigned NULL and passed to free(), and is clearly a leftover from a previous version. No backport needed. --- diff --git a/src/acl.c b/src/acl.c index 5950da97d..f03c065dc 100644 --- a/src/acl.c +++ b/src/acl.c @@ -138,7 +138,6 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list * const char *arg; struct sample_expr *smp = NULL; int idx = 0; - char *ckw = NULL; const char *endt; int cur_type; int nbargs; @@ -410,7 +409,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list * } if (aclkw) { - if (((aclkw->match_type == PAT_MATCH_BEG || aclkw->match_type == PAT_MATCH_DIR || aclkw->match_type == PAT_MATCH_DOM || + if (((aclkw->match_type == PAT_MATCH_BEG || aclkw->match_type == PAT_MATCH_DIR || aclkw->match_type == PAT_MATCH_DOM || aclkw->match_type == PAT_MATCH_END || aclkw->match_type == PAT_MATCH_LEN || aclkw->match_type == PAT_MATCH_REG || aclkw->match_type == PAT_MATCH_SUB) && expr->pat.match != pat_match_fcts[aclkw->match_type]) || @@ -593,7 +592,6 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list * prune_acl_expr(expr); free(expr); out_free_smp: - free(ckw); free(smp); out_return: return NULL;