]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix memory leak on host prefix removal
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 4 Jun 2018 17:31:34 +0000 (13:31 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 4 Jun 2018 17:31:34 +0000 (13:31 -0400)
When we have a host prefix, actually free the alloced memory
associated with it when we free it.

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

index 90604215e75dcd9899edba2a44f11efdcb0d1fd6..74c1f3f1781cc47a309ed8b25f2ddd2eefd78f7e 100644 (file)
@@ -3111,8 +3111,10 @@ static void rb_delete_host(struct host_rb_tree_entry *hrbe, struct prefix *host)
        memcpy(&lookup.p, host, sizeof(*host));
 
        hle = RB_FIND(host_rb_tree_entry, hrbe, &lookup);
-       if (hle)
+       if (hle) {
                RB_REMOVE(host_rb_tree_entry, hrbe, hle);
+               XFREE(MTYPE_HOST_PREFIX, hle);
+       }
 
        return;
 }