aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-megaco.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-10-06 19:15:58 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-10-06 19:15:58 +0000
commitbc9a809b65612063457f882a2d732707879ecb01 (patch)
tree012cd52cad567bcc246d8749709f1b72ebe86356 /epan/dissectors/packet-megaco.c
parent0f4d4344dd770cf06b0c4aaa9f945acc99f314d5 (diff)
From Didier Gautheron:
ep memory can't be used for tvbs defined as data_source. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4054 svn path=/trunk/; revision=30376
Diffstat (limited to 'epan/dissectors/packet-megaco.c')
-rw-r--r--epan/dissectors/packet-megaco.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index 3472cd15fe..9d257679d9 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -1734,7 +1734,6 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree,
{
proto_item *item;
proto_tree *tree;
- guint8 *buf = ep_alloc(10240);
/*item=proto_tree_add_string(megaco_tree, hf_megaco_h245, tvb,
offset, len, msg );
@@ -1748,6 +1747,7 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree,
if(len<20480){
int i;
tvbuff_t *h245_tvb;
+ guint8 *buf = g_malloc(10240);
/* first, skip to where the encoded pdu starts, this is
the first hex digit after the '=' char.
@@ -1807,6 +1807,7 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree,
return;
}
h245_tvb = tvb_new_child_real_data(tvb, buf,i,i);
+ tvb_set_free_cb(h245_tvb, g_free);
add_new_data_source(pinfo, h245_tvb, "H.245 over MEGACO");
/* should go through a handle, however, the two h245 entry
points are different, one is over tpkt and the other is raw
@@ -1819,13 +1820,13 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree,
static void
dissect_megaco_h324_h223caprn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree, gint offset _U_, gint len, gchar *msg)
{
- guint8 *buf = ep_alloc(10240);
asn1_ctx_t actx;
/* arbitrary maximum length */
if(len<20480){
int i;
tvbuff_t *h245_tvb;
+ guint8 *buf = g_malloc(10240);
/* first, skip to where the encoded pdu starts, this is
the first hex digit after the '=' char.
@@ -1886,6 +1887,7 @@ dissect_megaco_h324_h223caprn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *meg
}
h245_tvb = tvb_new_child_real_data(tvb, buf,i,i);
add_new_data_source(pinfo, h245_tvb, "H.245 over MEGACO");
+ tvb_set_free_cb(h245_tvb, g_free);
/* should go through a handle, however, the two h245 entry
points are different, one is over tpkt and the other is raw
*/