From: Vincent Bernat Date: Fri, 27 Feb 2009 13:11:19 +0000 (+0100) Subject: Fix double free for local ports X-Git-Tag: 0.3.1~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f758bc0080bb665f669a2ba8eb1713a8ced9037;p=thirdparty%2Flldpd.git Fix double free for local ports --- 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 */