if (rcs->additive && old) {
merge = community_merge(community_dup(old), rcs->com);
- /* HACK: if the old community is not intern'd,
- * we should free it here, or all reference to it may be
- * lost.
- * Really need to cleanup attribute caching sometime.
- */
- if (old->refcnt == 0)
- community_free(old);
new = community_uniq_sort(merge);
community_free(merge);
} else
new = community_dup(rcs->com);
+ /* HACK: if the old community is not intern'd,
+ * we should free it here, or all reference to it may be
+ * lost.
+ * Really need to cleanup attribute caching sometime.
+ */
+ if (old && old->refcnt == 0)
+ community_free(old);
+
/* will be interned by caller if required */
attr->community = new;