mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 16:57:44 +00:00
bgpd: Prevent asn dot memory leak
When allocating a new bit of memory free the old first. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
bed7867117
commit
3376972e5e
@ -6313,8 +6313,11 @@ int peer_local_as_set(struct peer *peer, as_t as, bool no_prepend,
|
||||
&& old_replace_as == replace_as)
|
||||
return 0;
|
||||
peer->change_local_as = as;
|
||||
if (as_str)
|
||||
if (as_str) {
|
||||
if (peer->change_local_as_pretty)
|
||||
XFREE(MTYPE_BGP, peer->change_local_as_pretty);
|
||||
peer->change_local_as_pretty = XSTRDUP(MTYPE_BGP, as_str);
|
||||
}
|
||||
|
||||
(void)peer_sort(peer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user