Skip to content

Commit 0217100

Browse files
authored
Merge pull request #17681 from FRRouting/mergify/bp/stable/9.1/pr-17675
bgpd: Fix memory leak when creating BMP connection with a source interface (backport #17675)
2 parents ad14f7a + ad65b9b commit 0217100

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bgpd/bgp_bmp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,8 +2143,11 @@ DEFPY(bmp_connect,
21432143
}
21442144

21452145
ba = bmp_active_get(bt, hostname, port);
2146-
if (srcif)
2146+
if (srcif) {
2147+
if (ba->ifsrc)
2148+
XFREE(MTYPE_TMP, ba->ifsrc);
21472149
ba->ifsrc = XSTRDUP(MTYPE_TMP, srcif);
2150+
}
21482151
if (min_retry_str)
21492152
ba->minretry = min_retry;
21502153
if (max_retry_str)

0 commit comments

Comments
 (0)