]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_lcommunity.c
bgpd: Check to ensure community attributes exist before freeing them
[mirror_frr.git] / bgpd / bgp_lcommunity.c
index f47ae91663ed5cd90a10226210558a055ff63c13..5900fcf862b91c2ab6c4d710be4ea55ee06ac17d 100644 (file)
@@ -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)