]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Fix double free for local ports
authorVincent Bernat <vbernat.ext@orange-ftgroup.com>
Fri, 27 Feb 2009 13:11:19 +0000 (14:11 +0100)
committerVincent Bernat <vbernat.ext@orange-ftgroup.com>
Fri, 27 Feb 2009 13:11:19 +0000 (14:11 +0100)
src/lldpd.c

index e6d16e4dcc77e6986f211968d48a6597da43c215..4a7ab1b6b3f5d83f71fe2a461ab41941d92ab095 100644 (file)
@@ -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 */