]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
coverity: remove unused pointer value
authorVincent Bernat <bernat@luffy.cx>
Fri, 22 Nov 2013 21:43:54 +0000 (22:43 +0100)
committerVincent Bernat <bernat@luffy.cx>
Fri, 22 Nov 2013 21:43:54 +0000 (22:43 +0100)
Also clarify how we use a similar pointer nearby.

src/daemon/interfaces-linux.c

index e4a7ddaecdf4d8652319b1e2cab9a9e2459ecd30..748d0eb3b7457286691596dcd9a31e4de6adf170 100644 (file)
@@ -551,7 +551,7 @@ iflinux_handle_bond(struct lldpd *cfg, struct interfaces_device_list *interfaces
                                    iface->name);
                                continue;
                        }
-                       hardware->h_data = bmaster = calloc(1, sizeof(struct bond_master));
+                       hardware->h_data = calloc(1, sizeof(struct bond_master));
                        if (!hardware->h_data) {
                                log_warn("interfaces", "not enough memory");
                                lldpd_hardware_cleanup(cfg, hardware);
@@ -569,7 +569,7 @@ iflinux_handle_bond(struct lldpd *cfg, struct interfaces_device_list *interfaces
                } else {
                        if (hardware->h_flags) continue; /* Already seen this time */
                        bmaster = hardware->h_data;
-                       memset(hardware->h_data, 0, sizeof(struct bond_master));
+                       memset(bmaster, 0, sizeof(struct bond_master));
                        bmaster->index = master->index;
                        strncpy(bmaster->name, master->name, IFNAMSIZ);
                        lldpd_port_cleanup(&hardware->h_lport, 0);