]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: log: remove deadcode in px_parse_log_steps()
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 16 Sep 2025 06:17:03 +0000 (08:17 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 17 Sep 2025 09:31:17 +0000 (11:31 +0200)
When logsteps proxy storage was migrated from eb nodes to bitmasks in
6a92b14 ("MEDIUM: log/proxy: store log-steps selection using a bitmask,
not an eb tree"), some unused eb node related code was left over in
px_parse_log_steps()

Not only this code is unused, it also resulted in wasted memory since
an eb node was allocated for nothing.

This should fix GH #3121

src/log.c

index fc6aeb9d1b94c8a7826909e04deda0d60260b9dc..a1cc0bc3e685ea339ad0ca3a6f449da293a8d215 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -6848,7 +6848,6 @@ static int px_parse_log_steps(char **args, int section_type, struct proxy *curpx
        str = args[1];
 
        while (str[0]) {
-               struct eb32_node *cur_step;
                enum log_orig_id cur_id = LOG_ORIG_UNSPEC;
 
                cur_sep = strcspn(str, ",");
@@ -6886,13 +6885,6 @@ static int px_parse_log_steps(char **args, int section_type, struct proxy *curpx
                        }
                }
 
-               cur_step = malloc(sizeof(*cur_step));
-               if (!cur_step) {
-                       memprintf(err, "memory failure when trying to configure log-step (%.*s)",
-                                 (int)cur_sep, str);
-                       goto end;
-               }
-               cur_step->key = cur_id;
                BUG_ON(cur_id > 64); // for now we don't support more than 64 log origins
                curpx->conf.log_steps.steps_1 |= (1ULL << cur_id);
  next: