aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-xml.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-08-19 10:39:43 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-08-19 10:39:43 +0000
commit81b6d6aab35eabd3c9687f3f2eb37466855fc137 (patch)
treec1b1f9007c72d8b33eea3271e54f7d0f139b7678 /epan/dissectors/packet-xml.c
parentb38ec03858d0c15811d2dc843379a61e3554ac9b (diff)
Do not use ephemeral memory when adding a new data source
svn path=/trunk/; revision=51423
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 ded7c3c219..0f94ed4a14 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -236,8 +236,9 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
dissect_xml(tvb, pinfo, tree);
return TRUE;
} else if (pref_heuristic_unicode) {
- const guint8 *data_str = tvb_get_ephemeral_unicode_string(tvb, 0, tvb_length(tvb), ENC_LITTLE_ENDIAN);
+ const guint8 *data_str = tvb_get_unicode_string(tvb, 0, tvb_length(tvb), ENC_LITTLE_ENDIAN);
tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_length(tvb)/2, tvb_length(tvb)/2);
+ tvb_set_free_cb(unicode_tvb, g_free);
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);