Fix tvb memory leak; Fix hex byte display for Unicode XML.
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 13 Dec 2011 22:49:59 +0000 (22:49 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 13 Dec 2011 22:49:59 +0000 (22:49 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40187 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-xml.c

index 0a185dde1f06988db1fdaa9118eba3b204b15cdc..645b739df76d09c1646ac7e1d1a93f361002e047 100644 (file)
@@ -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;
                        }