diff options
Diffstat (limited to 'epan/dissectors/packet-tcpros.c')
-rw-r--r-- | epan/dissectors/packet-tcpros.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-tcpros.c b/epan/dissectors/packet-tcpros.c index 24a2535f01..ed66fc40fe 100644 --- a/epan/dissectors/packet-tcpros.c +++ b/epan/dissectors/packet-tcpros.c @@ -99,11 +99,12 @@ dissect_ros_connection_header_field(tvbuff_t *tvb, proto_tree *tree, packet_info /** If we find a separator, then split field name and value */ if( sep > 0 ) { + const guint8* field; field_tree = proto_item_add_subtree(ti, ett_tcpros); - proto_tree_add_item(field_tree, hf_tcpros_connection_header_field_name, tvb, offset, sep, ENC_UTF_8|ENC_NA); + proto_tree_add_item_ret_string(field_tree, hf_tcpros_connection_header_field_name, tvb, offset, sep, ENC_UTF_8|ENC_NA, wmem_packet_scope(), &field); proto_tree_add_item(field_tree, hf_tcpros_connection_header_field_value, tvb, offset+sep+1, fLen - sep - 1, ENC_UTF_8|ENC_NA); - col_append_str(pinfo->cinfo, COL_INFO, tvb_get_string_enc(wmem_packet_scope(), tvb, offset, sep, ENC_UTF_8)); + col_append_str(pinfo->cinfo, COL_INFO, field); } ret = fLen + SIZE_OF_LENGTH_FIELD; } @@ -188,6 +189,7 @@ dissect_ros_message_header(tvbuff_t *tvb, proto_tree *root_tree, packet_info *pi guint32 frame_id_len; guint32 seq; guint header_len; + const guint8* frame_str; frame_id_len = tvb_get_letohl(tvb, offset + consumed_len + SIZE_OF_LENGTH_FIELD + SIZE_OF_LENGTH_STAMP); @@ -213,8 +215,8 @@ dissect_ros_message_header(tvbuff_t *tvb, proto_tree *root_tree, packet_info *pi proto_tree_add_item(sub_tree, hf_tcpros_message_header_frame_length, tvb, offset + consumed_len, SIZE_OF_LENGTH_FIELD, ENC_LITTLE_ENDIAN); consumed_len += SIZE_OF_LENGTH_FIELD; - proto_tree_add_item(sub_tree, hf_tcpros_message_header_frame_value, tvb, offset + consumed_len, frame_id_len, ENC_UTF_8|ENC_NA); - col_append_fstr(pinfo->cinfo, COL_INFO, "Frame: '%s' ", tvb_get_string_enc(wmem_packet_scope(), tvb, offset + consumed_len, frame_id_len, ENC_UTF_8) ); + proto_tree_add_item_ret_string(sub_tree, hf_tcpros_message_header_frame_value, tvb, offset + consumed_len, frame_id_len, ENC_UTF_8|ENC_NA, wmem_packet_scope(), &frame_str); + col_append_fstr(pinfo->cinfo, COL_INFO, "Frame: '%s' ", frame_str); consumed_len += frame_id_len; return consumed_len; |