aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-xml.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-12-13 22:49:59 +0000
committerBill Meier <wmeier@newsguy.com>2011-12-13 22:49:59 +0000
commit1311b2ab83c2e06695d83fea0de5e8e47f30802e (patch)
treed65d614566baa6416feb523d7fd0b7104b748bab /epan/dissectors/packet-xml.c
parent1c3504bd6e0833e5811aa89153e10f9a73438a0f (diff)
Fix tvb memory leak; Fix hex byte display for Unicode XML.
svn path=/trunk/; revision=40187
Diffstat (limited to 'epan/dissectors/packet-xml.c')
-rw-r--r--epan/dissectors/packet-xml.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 0a185dde1f..645b739df7 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -232,8 +232,9 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
return TRUE;
} else if (pref_heuristic_unicode) {
const guint8 *data = tvb_get_ephemeral_unicode_string(tvb, 0, tvb_length(tvb)/2, ENC_LITTLE_ENDIAN);
- tvbuff_t *unicode_tvb = tvb_new_real_data(data, tvb_length(tvb)/2, tvb_length(tvb)/2);
+ tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data, tvb_length(tvb)/2, tvb_length(tvb)/2);
if (tvbparse_peek(tvbparse_init(unicode_tvb,0,-1,NULL,want_ignore), want_heur)) {
+ add_new_data_source(pinfo, unicode_tvb, "UTF8");
dissect_xml(unicode_tvb, pinfo, tree);
return TRUE;
}