]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix a memleak on "set community none"
authorChristian Franke <chris@opensourcerouting.org>
Fri, 7 Dec 2012 14:26:09 +0000 (14:26 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 14 Jan 2013 15:09:19 +0000 (16:09 +0100)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_routemap.c

index f2204003299874ba56155e1d94045b3f01334849..40f207653428b494e47b97d2ebcb446254ca859c 100644 (file)
@@ -1347,6 +1347,9 @@ route_set_community (void *rule, struct prefix *prefix,
        {
          attr->flag &= ~(ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES));
          attr->community = NULL;
+         /* See the longer comment down below. */
+         if (old && old->refcnt == 0)
+           community_free(old);
          return RMAP_OKAY;
        }