Skip to content

Commit

Permalink
bgpd: Prevent use after free from coverity's perspective
Browse files Browse the repository at this point in the history
Prevent a use after free from coverity's perspective.  A
bgp node may have been freed.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Sep 19, 2023
1 parent e7f0bbb commit 4eaf14e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bgpd/bgp_mplsvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4eaf14e

Please sign in to comment.