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-icq.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-icq.c')
-rw-r--r-- | epan/dissectors/packet-icq.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c index fa659c69d8..a7a1124750 100644 --- a/epan/dissectors/packet-icq.c +++ b/epan/dissectors/packet-icq.c @@ -1087,17 +1087,13 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ rounded_size = ((((capturedsize - ICQ5_CL_SESSIONID) + 3)/4)*4) + ICQ5_CL_SESSIONID; /* rounded_size might exceed the tvb bounds so we can't just use tvb_memdup here. */ - decr_pd = (guint8 *)g_malloc(rounded_size); + decr_pd = (guint8 *)wmem_alloc(pinfo->pool, rounded_size); tvb_memcpy(tvb, decr_pd, 0, capturedsize); decrypt_v5(decr_pd, rounded_size, key); /* Allocate a new tvbuff, referring to the decrypted data. */ decr_tvb = tvb_new_child_real_data(tvb, decr_pd, capturedsize, pktsize); - /* Arrange that the allocated packet data copy be freed when the - tvbuff is freed. */ - tvb_set_free_cb(decr_tvb, g_free); - /* Add the decrypted data to the data source list. */ add_new_data_source(pinfo, decr_tvb, "Decrypted"); |