diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-09-19 15:48:57 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-09-19 15:48:57 -0400 | 
| commit | 4eaf14e1e3f07445b88b7775df12445cc8150d5f (patch) | |
| tree | 39983118ff8e27afc1d9a4d8ae7b571d836c6fa7 /bgpd | |
| parent | e7f0bbb1980660bdcf4595e88b60eadd41a0a172 (diff) | |
bgpd: Prevent use after free from coverity's perspective
Prevent a use after free from coverity's perspective.  A
bgp node may have been freed.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd')
| -rw-r--r-- | bgpd/bgp_mplsvpn.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 9b5d568636..00930dea6b 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1179,12 +1179,13 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn,  		/* Process change. */  		bgp_aggregate_increment(to_bgp, p, bpi, afi, safi);  		bgp_process(to_bgp, bn, afi, safi); -		bgp_dest_unlock_node(bn);  		if (debug)  			zlog_debug("%s: ->%s: %pBD Found route, changed attr",  				   __func__, to_bgp->name_pretty, bn); +		bgp_dest_unlock_node(bn); +  		return bpi;  	}  | 
