summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-05-04 20:19:51 +0200
committerGitHub <noreply@github.com>2022-05-04 20:19:51 +0200
commit50f1f2e724f8614ada1a1a02dd28f1ff3af06e08 (patch)
tree8923363c95ef0fb10fd63fd549f580a834b3cca4 /pbrd
parentMerge pull request #11144 from ton31337/fix/bgp_notification_gr (diff)
parent*: remove the checking returned value for hash_get() (diff)
downloadfrr-50f1f2e724f8614ada1a1a02dd28f1ff3af06e08.tar.xz
frr-50f1f2e724f8614ada1a1a02dd28f1ff3af06e08.zip
Merge pull request #11059 from anlancs/fix/bgpd-evnp-wrong-check-hashget
bgpd: fix memory leak for evpn
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_nht.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index fb0bd7258..cbff4832a 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -1041,8 +1041,9 @@ static int pbr_nht_individual_nexthop_vrf_handle(struct hash_bucket *b,
nhrcvi.nhrc);
nhrcvi.nhrc->nexthop.vrf_id =
pbr_vrf_id(pnhi->pbr_vrf);
- hash_get(pbr_nhrc_hash, nhrcvi.nhrc,
- hash_alloc_intern);
+ (void)hash_get(pbr_nhrc_hash,
+ nhrcvi.nhrc,
+ hash_alloc_intern);
pbr_send_rnh(&nhrcvi.nhrc->nexthop, true);
}
} while (nhrcvi.nhrc);
@@ -1087,7 +1088,8 @@ static void pbr_nht_nexthop_vrf_handle(struct hash_bucket *b, void *data)
if (pnhi.pnhc) {
pnhi.pnhc->nexthop.vrf_id = pbr_vrf_id(pbr_vrf);
- hash_get(pnhgc->nhh, pnhi.pnhc, hash_alloc_intern);
+ (void)hash_get(pnhgc->nhh, pnhi.pnhc,
+ hash_alloc_intern);
} else
pnhc->nexthop.vrf_id = pbr_vrf_id(pbr_vrf);
@@ -1141,11 +1143,11 @@ static void pbr_nht_nexthop_interface_handle(struct hash_bucket *b, void *data)
if (nhrc) {
hash_release(pbr_nhrc_hash, nhrc);
nhrc->nexthop.ifindex = ifp->ifindex;
- hash_get(pbr_nhrc_hash, nhrc, hash_alloc_intern);
+ (void)hash_get(pbr_nhrc_hash, nhrc, hash_alloc_intern);
}
pnhi.pnhc->nexthop.ifindex = ifp->ifindex;
- hash_get(pnhgc->nhh, pnhi.pnhc, hash_alloc_intern);
+ (void)hash_get(pnhgc->nhh, pnhi.pnhc, hash_alloc_intern);
pbr_map_check_interface_nh_group_change(pnhgc->name, ifp,
old_ifindex);
@@ -1290,7 +1292,7 @@ uint32_t pbr_nht_reserve_next_table_id(struct pbr_nexthop_group_cache *nhgc)
nhgc->table_id = pbr_next_unallocated_table_id;
/* Mark table id as allocated in id-indexed hash */
- hash_get(pbr_nhg_allocated_id_hash, nhgc, hash_alloc_intern);
+ (void)hash_get(pbr_nhg_allocated_id_hash, nhgc, hash_alloc_intern);
/* Pre-compute the next unallocated table id */
pbr_nht_update_next_unallocated_table_id();