]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: remove null check before free nh_labels
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 18 Mar 2020 16:02:19 +0000 (12:02 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 18 Mar 2020 16:02:19 +0000 (12:02 -0400)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/nexthop.c

index e23f8b0792b032e67ade5b290e5bfb1f98d47b5e..c3be0a71e67aa9ece57a89c05cad0287c410202b 100644 (file)
@@ -415,10 +415,8 @@ void nexthop_add_labels(struct nexthop *nexthop, enum lsp_types_t type,
 /* Free label information of nexthop, if present. */
 void nexthop_del_labels(struct nexthop *nexthop)
 {
-       if (nexthop->nh_label) {
-               XFREE(MTYPE_NH_LABEL, nexthop->nh_label);
-               nexthop->nh_label_type = ZEBRA_LSP_NONE;
-       }
+       XFREE(MTYPE_NH_LABEL, nexthop->nh_label);
+       nexthop->nh_label_type = ZEBRA_LSP_NONE;
 }
 
 const char *nexthop2str(const struct nexthop *nexthop, char *str, int size)