diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-04 21:19:51 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-04 21:19:51 +0300 | 
| commit | 50f1f2e724f8614ada1a1a02dd28f1ff3af06e08 (patch) | |
| tree | 8923363c95ef0fb10fd63fd549f580a834b3cca4 /pbrd | |
| parent | d98de984a908579ac1cd0c1a67f32e8381757c55 (diff) | |
| parent | 8e3aae66cec563cee0add26482f279c4aae67cb1 (diff) | |
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.c | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c index fb0bd72585..cbff4832a4 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();  | 
