]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: consolidate nexthop-group deletion in a single place
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 14 Feb 2019 22:00:14 +0000 (20:00 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 14 Feb 2019 22:00:14 +0000 (20:00 -0200)
Reuse the nhgl_delete() function to avoid code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/nexthop_group.c

index 23ea96f75c24a4332a9f453b218e9757f0fdc887..57609b648f7e62cbd367cd8edcda8504a498069f 100644 (file)
@@ -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,