aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-armagetronad.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-22 22:45:36 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-22 22:45:36 +0000
commitbe2e98e1ac27276738c2448476ae8d7cd9c9abf0 (patch)
tree46d8e1cfc5402d51aa9fa20533b399aebf6bdb4b /epan/dissectors/packet-armagetronad.c
parentc5e3c3f381d5d25b641ba5fd19f0cb02496c23a9 (diff)
replace one tvb_memdup() with a tvb_memcpy() using an automatically freed emem buffer
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14998 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-armagetronad.c')
-rw-r--r--epan/dissectors/packet-armagetronad.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-armagetronad.c b/epan/dissectors/packet-armagetronad.c
index 194e618723..a09dfa5f16 100644
--- a/epan/dissectors/packet-armagetronad.c
+++ b/epan/dissectors/packet-armagetronad.c
@@ -30,6 +30,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/emem.h>
/* Initialize the protocol and registered fields */
static int proto_armagetronad = -1;
@@ -142,8 +143,9 @@ add_message_data(tvbuff_t * tvb, gint offset, guint16 data_len,
{
guint16 *data = NULL;
- if (tree)
- data = (guint16 *) tvb_memdup(tvb, offset, data_len);
+ if (tree) {
+ data = (guint16*)tvb_memcpy(tvb, ep_alloc(data_len), offset, data_len);
+ }
if (data) {
guint16 *ptr, *end = &data[data_len / 2];
@@ -167,7 +169,6 @@ add_message_data(tvbuff_t * tvb, gint offset, guint16 data_len,
proto_tree_add_string(tree, hf_armagetronad_data, tvb, offset,
data_len, (gchar *) data);
- g_free(data);
data = NULL;
} else
proto_tree_add_item(tree, hf_armagetronad_data, tvb, offset,