chiark / gitweb /
lldp: fix uninitialized cleanup var #2
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 31 Dec 2014 15:07:17 +0000 (16:07 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 31 Dec 2014 15:07:17 +0000 (16:07 +0100)
Another uninitialized variable marked as _cleanup_. Set it to NULL to
avoid accessing uninitialized memory.

src/libsystemd-network/lldp-internal.c

index d03445b1e2aac3d64fc358553b4270ee9ee18167..f843fd256dd9e6ef37b9f749bf82adeb72967983 100644 (file)
@@ -496,7 +496,7 @@ int lldp_chassis_new(tlv_packet *tlv,
                      Prioq *by_expiry,
                      Hashmap *neighbour_mib,
                      lldp_chassis **ret) {
                      Prioq *by_expiry,
                      Hashmap *neighbour_mib,
                      lldp_chassis **ret) {
-        _cleanup_lldp_chassis_free_ lldp_chassis *c;
+        _cleanup_lldp_chassis_free_ lldp_chassis *c = NULL;
         uint16_t length;
         uint8_t *data;
         uint8_t type;
         uint16_t length;
         uint8_t *data;
         uint8_t type;