]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: pattern: Pattern node has type of "struct pat_idx_elt" in place of "struc...
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 9 Dec 2013 10:29:46 +0000 (11:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:39:01 +0000 (15:39 +0100)
The free() function must free the "struct pat_idx_elt".

This bug was introduced by commit ed66c29 (REORG: acl/pattern: extract
pattern matching from the acl file and create pattern.c), no backport
is needed.

src/pattern.c

index 4f049f735b3cc2cd3a91509e510663f282905560..aef2a00537286d190be1915a126e2defd4c93def 100644 (file)
@@ -769,11 +769,14 @@ void free_pattern_list(struct list *head)
 void free_pattern_tree(struct eb_root *root)
 {
        struct eb_node *node, *next;
+       struct pat_idx_elt *elt;
+
        node = eb_first(root);
        while (node) {
                next = eb_next(node);
                eb_delete(node);
-               free(node);
+               elt = container_of(node, struct pat_idx_elt, node);
+               free(elt);
                node = next;
        }
 }