mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 15:16:20 +00:00
Merge pull request #2424 from pacovn/Coverity_1399270_Dereference_after_null_check
bgpd: null check (Coverity 1399270)
This commit is contained in:
commit
9c96d82fd2
@ -102,6 +102,7 @@ struct community_list_handler *bgp_clist;
|
||||
unsigned int multipath_num = MULTIPATH_NUM;
|
||||
|
||||
static void bgp_if_finish(struct bgp *bgp);
|
||||
static void peer_drop_dynamic_neighbor(struct peer *peer);
|
||||
|
||||
extern struct zclient *zclient;
|
||||
|
||||
@ -3719,10 +3720,10 @@ struct peer *peer_lookup_dynamic_neighbor(struct bgp *bgp, union sockunion *su)
|
||||
return peer;
|
||||
}
|
||||
|
||||
void peer_drop_dynamic_neighbor(struct peer *peer)
|
||||
static void peer_drop_dynamic_neighbor(struct peer *peer)
|
||||
{
|
||||
int dncount = -1;
|
||||
if (peer->group && peer->group->bgp) {
|
||||
if (peer->group->bgp) {
|
||||
dncount = peer->group->bgp->dynamic_neighbors_count;
|
||||
if (dncount)
|
||||
peer->group->bgp->dynamic_neighbors_count = --dncount;
|
||||
@ -3732,7 +3733,6 @@ void peer_drop_dynamic_neighbor(struct peer *peer)
|
||||
peer->group->name, dncount);
|
||||
}
|
||||
|
||||
|
||||
/* If peer is configured at least one address family return 1. */
|
||||
int peer_active(struct peer *peer)
|
||||
{
|
||||
|
@ -1462,7 +1462,6 @@ extern struct peer_group *peer_group_lookup_dynamic_neighbor(struct bgp *,
|
||||
struct prefix **);
|
||||
extern struct peer *peer_lookup_dynamic_neighbor(struct bgp *,
|
||||
union sockunion *);
|
||||
extern void peer_drop_dynamic_neighbor(struct peer *);
|
||||
|
||||
/*
|
||||
* Peers are incredibly easy to memory leak
|
||||
|
Loading…
Reference in New Issue
Block a user