mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 10:32:00 +00:00
bgpd: Fix memory leak when creating BMP connection with a source interface
Testing done with:
```
for x in $(seq 1 100000); do vtysh -c 'conf' -c 'router bgp' -c 'bmp targets test' -c 'bmp connect localhost port 123 min-retry 100 max-retry 100 source-interface lo'; done
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7d19cb59cf
)
This commit is contained in:
parent
ad14f7a47d
commit
ad65b9b7f8
@ -2143,8 +2143,11 @@ DEFPY(bmp_connect,
|
||||
}
|
||||
|
||||
ba = bmp_active_get(bt, hostname, port);
|
||||
if (srcif)
|
||||
if (srcif) {
|
||||
if (ba->ifsrc)
|
||||
XFREE(MTYPE_TMP, ba->ifsrc);
|
||||
ba->ifsrc = XSTRDUP(MTYPE_TMP, srcif);
|
||||
}
|
||||
if (min_retry_str)
|
||||
ba->minretry = min_retry;
|
||||
if (max_retry_str)
|
||||
|
Loading…
Reference in New Issue
Block a user