Merge pull request #17675 from opensourcerouting/fix/memory_leaks_for_strdup

bgpd: Fix memory leak when creating BMP connection with a source interface
This commit is contained in:
Jafar Al-Gharaibeh 2024-12-19 15:55:07 -06:00 committed by GitHub
commit d875d70540
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2630,8 +2630,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)