summaryrefslogtreecommitdiff
path: root/bgpd/bgp_clist.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-05-30 19:30:12 -0400
committerDonald Sharp <sharpd@nvidia.com>2023-06-01 08:54:25 -0400
commit1f7038386e34fac1731014535bfea6a0b3892abc (patch)
tree1a8db95ebd6f8d31c92b04ab399f52903c450552 /bgpd/bgp_clist.c
parent3f1b34c49820773b25b46091f7f05be88e0763f0 (diff)
bgpd: community_list_set str is always non null
When calling community_list_set the str variable is always non NULL. As such let's treat it as such. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_clist.c')
-rw-r--r--bgpd/bgp_clist.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index 1d2ba3bf58..ac5cdd6acb 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -899,15 +899,13 @@ int community_list_set(struct community_list_handler *ch, const char *name,
}
}
- if (str) {
- if (style == COMMUNITY_LIST_STANDARD)
- com = community_str2com(str);
- else
- regex = bgp_regcomp(str);
+ if (style == COMMUNITY_LIST_STANDARD)
+ com = community_str2com(str);
+ else
+ regex = bgp_regcomp(str);
- if (!com && !regex)
- return COMMUNITY_LIST_ERR_MALFORMED_VAL;
- }
+ if (!com && !regex)
+ return COMMUNITY_LIST_ERR_MALFORMED_VAL;
entry = community_entry_new();
entry->direct = direct;