mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-02 18:56:53 +00:00
Merge pull request #6350 from pureport/fix/bgp_double_community_free
bgpd: Check to ensure community attributes exist before freeing them
This commit is contained in:
commit
794c2b2d73
@ -40,6 +40,9 @@ static struct community *community_new(void)
|
||||
/* Free communities value. */
|
||||
void community_free(struct community **com)
|
||||
{
|
||||
if (!(*com))
|
||||
return;
|
||||
|
||||
XFREE(MTYPE_COMMUNITY_VAL, (*com)->val);
|
||||
XFREE(MTYPE_COMMUNITY_STR, (*com)->str);
|
||||
|
||||
|
@ -59,6 +59,9 @@ void ecommunity_strfree(char **s)
|
||||
/* Allocate ecommunities. */
|
||||
void ecommunity_free(struct ecommunity **ecom)
|
||||
{
|
||||
if (!(*ecom))
|
||||
return;
|
||||
|
||||
XFREE(MTYPE_ECOMMUNITY_VAL, (*ecom)->val);
|
||||
XFREE(MTYPE_ECOMMUNITY_STR, (*ecom)->str);
|
||||
XFREE(MTYPE_ECOMMUNITY, *ecom);
|
||||
|
@ -44,6 +44,9 @@ static struct lcommunity *lcommunity_new(void)
|
||||
/* Allocate lcommunities. */
|
||||
void lcommunity_free(struct lcommunity **lcom)
|
||||
{
|
||||
if (!(*lcom))
|
||||
return;
|
||||
|
||||
XFREE(MTYPE_LCOMMUNITY_VAL, (*lcom)->val);
|
||||
XFREE(MTYPE_LCOMMUNITY_STR, (*lcom)->str);
|
||||
if ((*lcom)->json)
|
||||
|
Loading…
Reference in New Issue
Block a user