mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 11:44:16 +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
cbe7fc3a98
commit
5d0cef584f
@ -2392,8 +2392,11 @@ DEFPY(bmp_connect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ba = bmp_active_get(bt, hostname, port);
|
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);
|
ba->ifsrc = XSTRDUP(MTYPE_TMP, srcif);
|
||||||
|
}
|
||||||
if (min_retry_str)
|
if (min_retry_str)
|
||||||
ba->minretry = min_retry;
|
ba->minretry = min_retry;
|
||||||
if (max_retry_str)
|
if (max_retry_str)
|
||||||
|
Loading…
Reference in New Issue
Block a user