From: Philippe Guibert Date: Wed, 6 Dec 2023 17:34:02 +0000 (+0100) Subject: lib: fix memory leak when disabling nexthop_hold contexts X-Git-Tag: base_10.0~154^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F15089%2Fhead;p=mirror%2Ffrr.git lib: fix memory leak when disabling nexthop_hold contexts 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 --- diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index d1fd526d6e..3f408e0a71 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -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); } } }