#include <glib.h>
#include <epan/packet.h>
+#include <epan/emem.h>
/* Initialize the protocol and registered fields */
static int proto_armagetronad = -1;
{
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];
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,