summaryrefslogtreecommitdiff
path: root/lib/nexthop_group.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-02-14 20:00:14 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-02-14 20:00:14 -0200
commite5a501c2edd1f3f18ac0ce4c5d415c97cbfd0cc6 (patch)
tree84bfb47964455e697133997f8b972c130268ec81 /lib/nexthop_group.c
parent09720d318948a96bc7d8fa7b83a968b1018818b6 (diff)
lib: consolidate nexthop-group deletion in a single place
Reuse the nhgl_delete() function to avoid code duplication. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/nexthop_group.c')
-rw-r--r--lib/nexthop_group.c8
1 files changed, 1 insertions, 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,