stkutil: Refactor remote entity address

Don't assign to the return structure until we know we can successfully
parse.
This commit is contained in:
Denis Kenzior 2010-04-21 10:14:04 -05:00
parent fdfb64d9f1
commit d211da15b2
1 changed files with 2 additions and 2 deletions

View File

@ -1407,8 +1407,7 @@ static gboolean parse_dataobj_remote_entity_address(
data = comprehension_tlv_iter_get_data(iter);
rea->coding_type = data[0];
switch (rea->coding_type) {
switch (data[0]) {
case 0x00:
if (len != 7)
return FALSE;
@ -1421,6 +1420,7 @@ static gboolean parse_dataobj_remote_entity_address(
return FALSE;
}
rea->coding_type = data[0];
memcpy(&rea->addr, data + 1, len - 1);
return TRUE;