]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpd: fix a segfault when a port disappear
authorVincent Bernat <bernat@luffy.cx>
Tue, 13 Aug 2013 20:01:05 +0000 (22:01 +0200)
committerVincent Bernat <bernat@luffy.cx>
Tue, 13 Aug 2013 20:01:05 +0000 (22:01 +0200)
Due to previous recent change, a NULL function could be called when a
port disappear. Fix that.

src/lldpd-structs.c

index 376da98930b1cea03af5d57b5e5e99e6802379f8..5c907f0df151fd3a288c4136e94cc686c1900ac4 100644 (file)
@@ -130,7 +130,7 @@ lldpd_remote_cleanup(struct lldpd_hardware *hardware,
                        del = 1;
                }
                if (del) {
-                       expire(hardware, port);
+                       if (expire) expire(hardware, port);
                        TAILQ_REMOVE(&hardware->h_rports, port, p_entries);
                        lldpd_port_cleanup(port, 1);
                        free(port);