diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2016-11-01 10:37:50 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2016-11-28 19:15:27 +0100 |
commit | 658bbf6d704a776495dd7914c45efc399f03da52 (patch) | |
tree | b34b9cb30507481bca40539ff1491eb0e274d4d7 /bgpd | |
parent | bgpd: use loops to reduce code duplication (diff) | |
download | frr-658bbf6d704a776495dd7914c45efc399f03da52.tar.xz frr-658bbf6d704a776495dd7914c45efc399f03da52.zip |
bgpd: optimize copy of strings on peer_xfer_conn()
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_fsm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index ab4ea71d6..e669b4f9b 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -171,8 +171,7 @@ peer_xfer_conn(struct peer *from_peer) peer->hostname = NULL; } - peer->hostname = XSTRDUP(MTYPE_BGP_PEER_HOST, from_peer->hostname); - XFREE(MTYPE_BGP_PEER_HOST, from_peer->hostname); + peer->hostname = from_peer->hostname; from_peer->hostname = NULL; } @@ -184,8 +183,7 @@ peer_xfer_conn(struct peer *from_peer) peer->domainname= NULL; } - peer->domainname = XSTRDUP(MTYPE_BGP_PEER_HOST, from_peer->domainname); - XFREE(MTYPE_BGP_PEER_HOST, from_peer->domainname); + peer->domainname = from_peer->domainname; from_peer->domainname = NULL; } |