summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-02-14 23:00:14 +0100
committerRenato Westphal <renato@opensourcerouting.org>2019-02-14 23:00:14 +0100
commite5a501c2edd1f3f18ac0ce4c5d415c97cbfd0cc6 (patch)
tree84bfb47964455e697133997f8b972c130268ec81 /lib
parentMerge pull request #3799 from donaldsharp/show_debugging (diff)
downloadfrr-e5a501c2edd1f3f18ac0ce4c5d415c97cbfd0cc6.tar.xz
frr-e5a501c2edd1f3f18ac0ce4c5d415c97cbfd0cc6.zip
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')
-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 23ea96f75..57609b648 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,