#endif
/* If `all' is true, clear all information, including information that
- are not refreshed periodically. If `all' is true, also free the
- port. */
+ are not refreshed periodically. Port should be freed manually. */
void
lldpd_port_cleanup(struct lldpd_port *port, int all)
{
#endif
free(port->p_id);
free(port->p_descr);
- if (all)
- free(port);
}
void
{
if (hardware->h_rport != NULL) {
lldpd_port_cleanup(hardware->h_rport, 1);
+ free(hardware->h_rport);
hardware->h_rport = NULL;
}
if (hardware->h_rchassis != NULL) {
cleanup:
lldpd_chassis_cleanup(chassis);
lldpd_port_cleanup(port, 1);
+ free(port);
return;
}