]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix memory leak when disabling nexthop_hold contexts 15089/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 6 Dec 2023 17:34:02 +0000 (18:34 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 4 Jan 2024 16:12:36 +0000 (17:12 +0100)
A memory leak is detected when stopping the sharpd daemon
with a nexthop group configuration that includes nexthops.

The nexthop_hold structure and its attributes are not
freed. Fix it by adding the missing free function.

Fixes: 98cbbaea91f6 ("lib: Handle if up/down and vrf enable/disable events")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
lib/nexthop_group.c

index d1fd526d6e279eae38ebea516a30ab7ce3b20177..3f408e0a71f921c15b4a8610a06a62b1d608ec94 100644 (file)
@@ -1260,6 +1260,8 @@ void nexthop_group_disable_vrf(struct vrf *vrf)
                        nexthop_free(nh);
 
                        list_delete_node(nhgc->nhg_list, node);
+
+                       nhgl_delete(nhh);
                }
        }
 }