mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-01 17:59:27 +00:00
zebra: The dplane_fpm_nl return path leaks memory
The route entry created when using a ctx to pass route
entry data backup to the master pthread in zebra is
being leaked. Prevent this from happening.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7f9c5c7fa2
)
This commit is contained in:
parent
a32620de4e
commit
ff23fdfb4b
@ -345,6 +345,8 @@ extern void _route_entry_dump(const char *func, union prefixconstptr pp,
|
|||||||
union prefixconstptr src_pp,
|
union prefixconstptr src_pp,
|
||||||
const struct route_entry *re);
|
const struct route_entry *re);
|
||||||
|
|
||||||
|
void zebra_rib_route_entry_free(struct route_entry *re);
|
||||||
|
|
||||||
struct route_entry *
|
struct route_entry *
|
||||||
zebra_rib_route_entry_new(vrf_id_t vrf_id, int type, uint8_t instance,
|
zebra_rib_route_entry_new(vrf_id_t vrf_id, int type, uint8_t instance,
|
||||||
uint32_t flags, uint32_t nhe_id, uint32_t table_id,
|
uint32_t flags, uint32_t nhe_id, uint32_t table_id,
|
||||||
|
@ -1025,6 +1025,8 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h,
|
|||||||
re, ng, startup, ctx);
|
re, ng, startup, ctx);
|
||||||
if (ng)
|
if (ng)
|
||||||
nexthop_group_delete(&ng);
|
nexthop_group_delete(&ng);
|
||||||
|
if (ctx)
|
||||||
|
zebra_rib_route_entry_free(re);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* I really don't see how this is possible
|
* I really don't see how this is possible
|
||||||
|
@ -4267,6 +4267,12 @@ struct route_entry *zebra_rib_route_entry_new(vrf_id_t vrf_id, int type,
|
|||||||
|
|
||||||
return re;
|
return re;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void zebra_rib_route_entry_free(struct route_entry *re)
|
||||||
|
{
|
||||||
|
XFREE(MTYPE_RE, re);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal route-add implementation; there are a couple of different public
|
* Internal route-add implementation; there are a couple of different public
|
||||||
* signatures. Callers in this path are responsible for the memory they
|
* signatures. Callers in this path are responsible for the memory they
|
||||||
|
Loading…
Reference in New Issue
Block a user