diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-04-21 17:26:38 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-04-21 18:29:17 +0000 |
commit | 91cae7cf412043d5c76d4bab6fbcf69a04a553dd (patch) | |
tree | 7ced7273ce347f9cfaf291808a24ef1ce78e9793 /epan/dissectors/packet-xtp.c | |
parent | 2048bc225875257bbf8810e4e103324629e3693a (diff) |
Do not mix wmem and glib allocators
Change-Id: I4bf861ed9e6b767341f2cbd4e926606d4919f2ef
Reviewed-on: https://code.wireshark.org/review/15041
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-xtp.c')
-rw-r--r-- | epan/dissectors/packet-xtp.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c index 2f81a16cc5..2eeea7a0de 100644 --- a/epan/dissectors/packet-xtp.c +++ b/epan/dissectors/packet-xtp.c @@ -844,11 +844,8 @@ dissect_xtp_jcntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { guint32 len = tvb_reported_length_remaining(tvb, offset); - guint32 start = offset; proto_item *ti; proto_tree *xtp_subtree; - struct xtp_diag diag[1]; - guint32 msg_len; xtp_subtree = proto_tree_add_subtree(tree, tvb, offset, len, ett_xtp_diag, &ti, "Diagnostic Segment"); @@ -859,31 +856,17 @@ dissect_xtp_diag(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { return; } - /** parse **/ /* code(4) */ - diag->code = tvb_get_ntohl(tvb, offset); + proto_tree_add_item(xtp_subtree, hf_xtp_diag_code, + tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* val(4) */ - diag->val = tvb_get_ntohl(tvb, offset); + proto_tree_add_item(xtp_subtree, hf_xtp_diag_val, + tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; /* message(n) */ - msg_len = tvb_reported_length_remaining(tvb, offset); - diag->msg = tvb_get_string_enc(NULL, tvb, offset, msg_len, ENC_ASCII); - - /** display **/ - offset = start; - /* code(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_diag_code, - tvb, offset, 4, diag->code); - offset += 4; - /* val(4) */ - proto_tree_add_uint(xtp_subtree, hf_xtp_diag_val, - tvb, offset, 4, diag->val); - offset += 4; - /* message(4) */ - proto_tree_add_string(xtp_subtree, hf_xtp_diag_msg, - tvb, offset, msg_len, diag->msg); - g_free(diag->msg); + proto_tree_add_item(xtp_subtree, hf_xtp_diag_msg, + tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA); return; } |