diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-04-05 10:12:22 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-04-05 10:14:34 +0200 |
commit | c41a3cc5289f23d2aa70b5a9d8ddb7ebe408c54f (patch) | |
tree | 05f1963361a28bf2d028e4a5cd20fb38f2401515 | |
parent | bgpd: Track RTRLib memory allocations separately (diff) | |
download | frr-c41a3cc5289f23d2aa70b5a9d8ddb7ebe408c54f.tar.xz frr-c41a3cc5289f23d2aa70b5a9d8ddb7ebe408c54f.zip |
bgpd: No need to check for NULL before calling XFREE() in RPKI code
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
-rw-r--r-- | bgpd/bgp_rpki.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index cbccc4423..a7bc89e64 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -903,9 +903,8 @@ static void free_cache(struct cache *cache) if (cache->type == TCP) { XFREE(MTYPE_BGP_RPKI_CACHE, cache->tr_config.tcp_config->host); XFREE(MTYPE_BGP_RPKI_CACHE, cache->tr_config.tcp_config->port); - if (cache->tr_config.tcp_config->bindaddr) - XFREE(MTYPE_BGP_RPKI_CACHE, - cache->tr_config.tcp_config->bindaddr); + XFREE(MTYPE_BGP_RPKI_CACHE, + cache->tr_config.tcp_config->bindaddr); XFREE(MTYPE_BGP_RPKI_CACHE, cache->tr_config.tcp_config); } #if defined(FOUND_SSH) @@ -917,9 +916,8 @@ static void free_cache(struct cache *cache) cache->tr_config.ssh_config->client_privkey_path); XFREE(MTYPE_BGP_RPKI_CACHE, cache->tr_config.ssh_config->server_hostkey_path); - if (cache->tr_config.ssh_config->bindaddr) - XFREE(MTYPE_BGP_RPKI_CACHE, - cache->tr_config.ssh_config->bindaddr); + XFREE(MTYPE_BGP_RPKI_CACHE, + cache->tr_config.ssh_config->bindaddr); XFREE(MTYPE_BGP_RPKI_CACHE, cache->tr_config.ssh_config); } #endif |