aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-security.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-19 22:53:28 -0400
committerEvan Huus <eapache@gmail.com>2016-07-20 22:12:56 +0000
commitbe1398c17ca1d5b203a930d9254125d602830aef (patch)
tree611a6c211931f45a32d65199fa65c4a5a36fec2f /epan/dissectors/packet-zbee-security.c
parente07b4aa6670f57be7f613eec9d8d47712d1cfa86 (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-zbee-security.c')
-rw-r--r--epan/dissectors/packet-zbee-security.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c
index 00f9bbbaf2..38d245f0e8 100644
--- a/epan/dissectors/packet-zbee-security.c
+++ b/epan/dissectors/packet-zbee-security.c
@@ -648,7 +648,7 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
}
/* Allocate memory to decrypt the payload into. */
- dec_buffer = (guint8 *)g_malloc(payload_len);
+ dec_buffer = (guint8 *)wmem_alloc(pinfo->pool, payload_len);
decrypted = FALSE;
if ( packet.src64 ) {
@@ -748,14 +748,11 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
/* Found a key that worked, setup the new tvbuff_t and return */
payload_tvb = tvb_new_child_real_data(tvb, dec_buffer, payload_len, payload_len);
- tvb_set_free_cb(payload_tvb, g_free); /* set up callback to free dec_buffer */
add_new_data_source(pinfo, payload_tvb, "Decrypted ZigBee Payload");
/* Done! */
return payload_tvb;
}
-
- g_free(dec_buffer);
#endif /* HAVE_LIBGCRYPT */
/* Add expert info. */