Reduce memory heap fragmentation and pressure on the memory allocator.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
struct attr *attr = *pattr;
struct attr *ret;
struct attr tmp;
+ struct attr_extra tmp_extra;
/* Decrement attribute reference. */
attr->refcnt--;
if (attr->extra)
{
- tmp.extra = bgp_attr_extra_new ();
+ tmp.extra = &tmp_extra;
memcpy (tmp.extra, attr->extra, sizeof (struct attr_extra));
}
}
bgp_attr_unintern_sub (&tmp);
- bgp_attr_extra_free (&tmp);
}
void