lldp: fix uninitialized cleanup var

Make sure to set _cleanup_ variables to NULL. Otherwise, we free
uninitialized objects.
This commit is contained in:
David Herrmann
2014-12-31 16:04:55 +01:00
parent c5285fbfce
commit e7a2419a2a
+1 -1
View File
@@ -443,7 +443,7 @@ void lldp_neighbour_port_free(lldp_neighbour_port *p) {
int lldp_neighbour_port_new(lldp_chassis *c,
tlv_packet *tlv,
lldp_neighbour_port **ret) {
_cleanup_lldp_neighbour_port_free_ lldp_neighbour_port *p;
_cleanup_lldp_neighbour_port_free_ lldp_neighbour_port *p = NULL;
uint16_t length, ttl;
uint8_t *data;
uint8_t type;