]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: map: Cleanup the initialisation of map descriptors.
authorThierry FOURNIER <tfournier@exceliance.fr>
Thu, 5 Dec 2013 10:59:55 +0000 (11:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Dec 2013 10:38:36 +0000 (11:38 +0100)
The association between struct map_descriptor and its struct
map_reference must be done in the function map_create_descriptor().

src/map.c

index 81c61eb95f7fc06beb0c1be1f3646d41508f0629..2ed9f3a9f6873e39bd2f9fda2daa777639de5589 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -168,6 +168,7 @@ static struct map_descriptor *map_create_descriptor(struct map_reference *ref,
                return NULL;
 
        desc->conv = conv;
+       desc->ref = ref;
 
        LIST_ADDQ(&ref->maps, &desc->list);
 
@@ -366,7 +367,6 @@ static int sample_load_map(struct arg *arg, struct sample_conv *conv, char **err
                return 0;
        }
 
-       desc->ref = ref;
        pattern_init_expr(&desc->pat);
 
        /* set the match method */