diff options
author | F. Aragon <paco@voltanet.io> | 2018-11-16 20:13:38 +0100 |
---|---|---|
committer | F. Aragon <paco@voltanet.io> | 2018-11-16 20:13:43 +0100 |
commit | 449cff3ed78dc8b4c526420d0328bb4af5028459 (patch) | |
tree | 5a48c1c3c52305bb15159a623a3a21623b1682b0 | |
parent | Merge pull request #3348 from donaldsharp/bsd_route_install (diff) | |
download | frr-449cff3ed78dc8b4c526420d0328bb4af5028459.tar.xz frr-449cff3ed78dc8b4c526420d0328bb4af5028459.zip |
bgpd: fix resource leak (Coverity 1475489)
Signed-off-by: F. Aragon <paco@voltanet.io>
-rw-r--r-- | bgpd/bgp_network.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index a310b7ba7..e15b8f4ec 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -709,8 +709,10 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address) return -1; } if (bgp_option_check(BGP_OPT_NO_ZEBRA) && - bgp->vrf_id != VRF_DEFAULT) + bgp->vrf_id != VRF_DEFAULT) { + freeaddrinfo(ainfo_save); return -1; + } count = 0; for (ainfo = ainfo_save; ainfo; ainfo = ainfo->ai_next) { int sock; |