summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_open.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-02-04 19:19:37 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-02-04 19:19:37 +0100
commite1b36e132b7eda2d230f2f95945e231df37a42f5 (patch)
tree8a40165810e2ddc3f3d3ca0709134554b766b5ca /bgpd/bgp_open.c
parent*: don't null after XFREE; XFREE does this itself (diff)
downloadfrr-e1b36e132b7eda2d230f2f95945e231df37a42f5.tar.xz
frr-e1b36e132b7eda2d230f2f95945e231df37a42f5.zip
*: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_open.c')
-rw-r--r--bgpd/bgp_open.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index f97827931..2d3dc1355 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -710,13 +710,8 @@ static int bgp_capability_hostname(struct peer *peer,
if (len) {
str[len] = '\0';
- if (peer->hostname != NULL) {
- XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);
- }
-
- if (peer->domainname != NULL) {
- XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
- }
+ XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);
+ XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
peer->hostname = XSTRDUP(MTYPE_BGP_PEER_HOST, str);
}
@@ -748,9 +743,7 @@ static int bgp_capability_hostname(struct peer *peer,
if (len) {
str[len] = '\0';
- if (peer->domainname != NULL) {
- XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
- }
+ XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
peer->domainname = XSTRDUP(MTYPE_BGP_PEER_HOST, str);
}