summaryrefslogtreecommitdiff
path: root/bgpd/bgp_community.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2011-07-29 18:16:25 +0100
committerPaul Jakma <paul@quagga.net>2011-07-29 18:16:25 +0100
commit036a6e6cf63a1046ab260d090719b305069288eb (patch)
tree638b920464ce82b188e32013f768d6f5d7b1a6dd /bgpd/bgp_community.c
parent8dd1a8daae0b15065d54c46f82d44d21aa7a2320 (diff)
parentb881c7074bb698aeb1b099175b325734fc6e44d2 (diff)
Merge branch 'attr-errors'
Contains BGP fixes: - set extcommunity crash: tihs patch tries to make the refcounting more robust but does not fully solve the problem, sadly. - BGP attribute error handling: Little testing.
Diffstat (limited to 'bgpd/bgp_community.c')
-rw-r--r--bgpd/bgp_community.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index ae1d7a15..2ba45f6e 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -321,21 +321,22 @@ community_intern (struct community *com)
/* Free community attribute. */
void
-community_unintern (struct community *com)
+community_unintern (struct community **com)
{
struct community *ret;
- if (com->refcnt)
- com->refcnt--;
+ if ((*com)->refcnt)
+ (*com)->refcnt--;
/* Pull off from hash. */
- if (com->refcnt == 0)
+ if ((*com)->refcnt == 0)
{
/* Community value com must exist in hash. */
- ret = (struct community *) hash_release (comhash, com);
+ ret = (struct community *) hash_release (comhash, *com);
assert (ret != NULL);
- community_free (com);
+ community_free (*com);
+ *com = NULL;
}
}