]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: vars: Set variable type to ANY upon creation
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 16 Dec 2021 16:14:35 +0000 (17:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 Dec 2021 16:31:31 +0000 (17:31 +0100)
The type of a newly created variable was not initialized. This patch
sets it to SMP_T_ANY by default. This will be required when conditions
can be added to a set-var call because we might end up creating a
variable without setting it yet.

src/vars.c

index 4c5f88b896e16da09ec6b085545b7faf04fa312e..27fc23d11d6cc633151a5bff95c4057078d60c29 100644 (file)
@@ -364,6 +364,7 @@ static int var_set(uint64_t name_hash, enum vars_scope scope, struct sample *smp
                LIST_APPEND(&vars->head, &var->l);
                var->name_hash = name_hash;
                var->flags = flags & VF_PERMANENT;
+               var->data.type = SMP_T_ANY;
        }
 
        /* Set type. */