From e5a501c2edd1f3f18ac0ce4c5d415c97cbfd0cc6 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 14 Feb 2019 20:00:14 -0200 Subject: [PATCH] lib: consolidate nexthop-group deletion in a single place Reuse the nhgl_delete() function to avoid code duplication. Signed-off-by: Renato Westphal --- lib/nexthop_group.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index 23ea96f75c..57609b648f 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -322,13 +322,7 @@ static void nexthop_group_unsave_nhop(struct nexthop_group_cmd *nhgc, return; list_delete_node(nhgc->nhg_list, node); - - if (nh->nhvrf_name) - XFREE(MTYPE_TMP, nh->nhvrf_name); - if (nh->intf) - XFREE(MTYPE_TMP, nh->intf); - - XFREE(MTYPE_TMP, nh); + nhgl_delete(nh); } static bool nexthop_group_parse_nexthop(struct nexthop *nhop, -- 2.39.5