From: Renato Westphal Date: Thu, 14 Feb 2019 22:00:14 +0000 (-0200) Subject: lib: consolidate nexthop-group deletion in a single place X-Git-Tag: 7.1_pulled~154^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e5a501c2edd1f3f18ac0ce4c5d415c97cbfd0cc6;p=mirror%2Ffrr.git lib: consolidate nexthop-group deletion in a single place Reuse the nhgl_delete() function to avoid code duplication. Signed-off-by: Renato Westphal --- 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,