From 332560792c6ef0b5c3d9719801b64d0d5f374639 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 10 Feb 2015 21:17:26 +0100 Subject: test-lldp: fix minor OOM --- src/libsystemd-network/test-lldp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libsystemd-network/test-lldp.c b/src/libsystemd-network/test-lldp.c index f81284e2a7..ee74ebd418 100644 --- a/src/libsystemd-network/test-lldp.c +++ b/src/libsystemd-network/test-lldp.c @@ -131,7 +131,8 @@ static int lldp_parse_chassis_tlv(tlv_packet *m, uint8_t *type) { } static int lldp_parse_port_id_tlv(tlv_packet *m) { - char *str = NULL, *p; + _cleanup_free_ char *p = NULL; + char *str = NULL; uint16_t length; uint8_t subtype; @@ -158,7 +159,8 @@ static int lldp_parse_port_id_tlv(tlv_packet *m) { } static int lldp_parse_system_name_tlv(tlv_packet *m) { - char *str = NULL, *p; + _cleanup_free_ char *p = NULL; + char *str = NULL; uint16_t length; assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_SYSTEM_NAME) >= 0); @@ -175,7 +177,8 @@ static int lldp_parse_system_name_tlv(tlv_packet *m) { } static int lldp_parse_system_desc_tlv(tlv_packet *m) { - char *str = NULL, *p; + _cleanup_free_ char *p = NULL; + char *str = NULL; uint16_t length; assert_se(lldp_tlv_packet_enter_container(m, LLDP_TYPE_SYSTEM_DESCRIPTION) >= 0); -- cgit v1.2.3-54-g00ecf