lldp: Fix lldp memory leak.
lldp_create() malloc memory for lldp->lldpd->g_hardware. lldp_unref
is supposed to free the memory regardless of hw->h_flags.
Acked-by: Eelco Chaudron
Acked-by: Paolo Valerio
@@ -140,13 +140,9 @@ lldpd_cleanup(struct lldpd *cfg)
VLOG_DBG("cleanup all ports");
LIST_FOR_EACH_SAFE (hw, h_entries, &cfg->g_hardware) {
- if (!hw->h_flags) {
ovs_list_remove(&hw->h_entries);
lldpd_remote_cleanup(hw, NULL, true);
lldpd_hardware_cleanup(cfg, hw);
- } else {
- lldpd_remote_cleanup(hw, NULL, false);
- }
}
VLOG_DBG("cleanup all chassis");
