From 4f758bc0080bb665f669a2ba8eb1713a8ced9037 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 27 Feb 2009 14:11:19 +0100 Subject: [PATCH] Fix double free for local ports --- src/lldpd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lldpd.c b/src/lldpd.c index e6d16e4d..4a7ab1b6 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -426,9 +426,6 @@ lldpd_remote_cleanup(struct lldpd *cfg, struct lldpd_hardware *hardware, int res void lldpd_hardware_cleanup(struct lldpd_hardware *hardware) { -#ifdef ENABLE_DOT1 - lldpd_vlan_cleanup(&hardware->h_lport); -#endif lldpd_port_cleanup(&hardware->h_lport); free(hardware->h_proto_macs); free(hardware->h_llastframe); @@ -576,7 +573,7 @@ lldpd_port_add(struct lldpd *cfg, struct ifaddrs *ifa) fatal(NULL); memcpy(port->p_id, hardware->h_lladdr, sizeof(hardware->h_lladdr)); port->p_id_len = sizeof(hardware->h_lladdr); - port->p_descr = hardware->h_ifname; + port->p_descr = strdup(hardware->h_ifname); if (cfg->g_lchassis.c_id == NULL) { /* Use the first port's l2 addr as the chassis ID */ -- 2.39.5