Skip to content

Commit 7882bd3

Browse files
authored
Merge pull request #17682 from FRRouting/mergify/bp/stable/9.0/pr-17675
bgpd: Fix memory leak when creating BMP connection with a source interface (backport #17675)
2 parents 241073f + e8077b5 commit 7882bd3

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
@@ -2141,8 +2141,11 @@ DEFPY(bmp_connect,
21412141
}
21422142

21432143
ba = bmp_active_get(bt, hostname, port);
2144-
if (srcif)
2144+
if (srcif) {
2145+
if (ba->ifsrc)
2146+
XFREE(MTYPE_TMP, ba->ifsrc);
21452147
ba->ifsrc = XSTRDUP(MTYPE_TMP, srcif);
2148+
}
21462149
if (min_retry_str)
21472150
ba->minretry = min_retry;
21482151
if (max_retry_str)

0 commit comments

Comments
 (0)