diff options
author | Santosh P K <50885001+Spantik@users.noreply.github.com> | 2020-03-24 16:59:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 16:59:06 +0100 |
commit | aa50bf0618f9f6e6dc61cbd5753938f6f5f3f235 (patch) | |
tree | d1a7c7d34db2cdfe942baf683ab2c786023d6e96 | |
parent | Merge pull request #6068 from donaldsharp/agg_to_use_rn_lookup (diff) | |
parent | lib: remove null check before free nh_labels (diff) | |
download | frr-aa50bf0618f9f6e6dc61cbd5753938f6f5f3f235.tar.xz frr-aa50bf0618f9f6e6dc61cbd5753938f6f5f3f235.zip |
Merge pull request #6035 from qlyoung/fix-nexthop-label-nullity-before-free
lib: remove null check before free nh_labels
-rw-r--r-- | lib/nexthop.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c index e23f8b079..c3be0a71e 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -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) |