The usage of MTYPE_ECOMMUNITY for the free in ecommunity_del_val
caused the ref counts for the ecommunity to be incorrect.
Use MTYPE_ECOMMUNITY_VAL since that is what we are deleting.
Ticket: CM-20602
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
memcpy(p + (c)*ECOMMUNITY_SIZE,
ecom->val + (c + 1) * ECOMMUNITY_SIZE,
(ecom->size - c) * ECOMMUNITY_SIZE);
memcpy(p + (c)*ECOMMUNITY_SIZE,
ecom->val + (c + 1) * ECOMMUNITY_SIZE,
(ecom->size - c) * ECOMMUNITY_SIZE);
- XFREE(MTYPE_ECOMMUNITY, ecom->val);
+ XFREE(MTYPE_ECOMMUNITY_VAL, ecom->val);
ecom->val = p;
return 1;
}
ecom->val = p;
return 1;
}