]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: When freeing the early route queue, actually free it right
authorDonald Sharp <sharpd@nvidia.com>
Wed, 14 Dec 2022 19:20:26 +0000 (14:20 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 15 Dec 2022 16:15:33 +0000 (11:15 -0500)
The early route queue has a series of `struct zebra_early_route *`
entries.  Zebra is treating this memory as just a `struct route entry`.
This is wrong.  Correct this to free the memory correctly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_rib.c

index fda21b2016cff367cb6393fdc15176d616d5f362..9551f26d8009ce56c25daf01f0cd4dc792e5840f 100644 (file)
@@ -3681,14 +3681,14 @@ static void rib_meta_queue_free(struct meta_queue *mq, struct list *l,
 static void early_route_meta_queue_free(struct meta_queue *mq, struct list *l,
                                        struct zebra_vrf *zvrf)
 {
-       struct zebra_early_route *zer;
+       struct zebra_early_route *ere;
        struct listnode *node, *nnode;
 
-       for (ALL_LIST_ELEMENTS(l, node, nnode, zer)) {
-               if (zvrf && zer->re->vrf_id != zvrf->vrf->vrf_id)
+       for (ALL_LIST_ELEMENTS(l, node, nnode, ere)) {
+               if (zvrf && ere->re->vrf_id != zvrf->vrf->vrf_id)
                        continue;
 
-               XFREE(MTYPE_RE, zer);
+               early_route_memory_free(ere);
                node->data = NULL;
                list_delete_node(l, node);
                mq->size--;