diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-19 22:53:28 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2016-07-20 22:12:56 +0000 |
commit | be1398c17ca1d5b203a930d9254125d602830aef (patch) | |
tree | 611a6c211931f45a32d65199fa65c4a5a36fec2f /epan/dissectors/packet-dcp-etsi.c | |
parent | e07b4aa6670f57be7f613eec9d8d47712d1cfa86 (diff) |
Convert uses of g_alloced data with tvb_new_child_real_data to use pinfo->pool instead.
Aldo update documentation to suggest using wmem pinfo->pool instead of glib memory
Change-Id: I5d34cc6c1515aa9f0d57784b38da501ffcb95ccc
Reviewed-on: https://code.wireshark.org/review/16551
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: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dcp-etsi.c')
-rw-r--r-- | epan/dissectors/packet-dcp-etsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c index 35acba77a7..32cd8588e7 100644 --- a/epan/dissectors/packet-dcp-etsi.c +++ b/epan/dissectors/packet-dcp-etsi.c @@ -343,13 +343,12 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, tvbuff_t *dtvb = NULL; const guint8 *input = tvb_get_ptr(new_tvb, 0, -1); guint32 reassembled_size = tvb_captured_length(new_tvb); - guint8 *deinterleaved = (guint8*) g_malloc (reassembled_size); - guint8 *output = (guint8*) g_malloc (decoded_size); + guint8 *deinterleaved = (guint8*) wmem_alloc(pinfo->pool, reassembled_size); + guint8 *output = (guint8*) wmem_alloc(pinfo->pool, decoded_size); rs_deinterleave(input, deinterleaved, plen, fcount); dtvb = tvb_new_child_real_data(tvb, deinterleaved, reassembled_size, reassembled_size); add_new_data_source(pinfo, dtvb, "Deinterleaved"); - tvb_set_free_cb(dtvb, g_free); decoded = rs_correct_data(deinterleaved, output, c_max, rsk, rsz); if(tree) @@ -357,7 +356,6 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, new_tvb = tvb_new_child_real_data(dtvb, output, decoded_size, decoded_size); add_new_data_source(pinfo, new_tvb, "RS Error Corrected Data"); - tvb_set_free_cb(new_tvb, g_free); } return new_tvb; } |