summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-10 21:17:26 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-10 21:17:26 +0100
commit332560792c6ef0b5c3d9719801b64d0d5f374639 (patch)
tree0fe1e77cfb5da19db5d55a10ea7cb8123c0b6f07 /src
parent804138a08c1fd6a4a3c19ead91eeb8ef312c36a0 (diff)
test-lldp: fix minor OOM
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/test-lldp.c9
1 files 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);