aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-lapsat.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-08-19 10:39:43 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-08-19 10:39:43 +0000
commit81b6d6aab35eabd3c9687f3f2eb37466855fc137 (patch)
treec1b1f9007c72d8b33eea3271e54f7d0f139b7678 /epan/dissectors/packet-lapsat.c
parentb38ec03858d0c15811d2dc843379a61e3554ac9b (diff)
Do not use ephemeral memory when adding a new data source
svn path=/trunk/; revision=51423
Diffstat (limited to 'epan/dissectors/packet-lapsat.c')
-rw-r--r--epan/dissectors/packet-lapsat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-lapsat.c b/epan/dissectors/packet-lapsat.c
index beda41f7d8..9c07c15a39 100644
--- a/epan/dissectors/packet-lapsat.c
+++ b/epan/dissectors/packet-lapsat.c
@@ -504,10 +504,10 @@ dissect_lapsat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((plen + hlen) == tvb_length(tvb)) {
/* Need to integrate the last nibble */
- guint8 *data = (guint8 *)ep_alloc(plen);
- tvb_memcpy(tvb, data, hlen, plen);
+ guint8 *data = (guint8 *)tvb_memdup(tvb, hlen, plen);
data[plen-1] |= tvb_get_guint8(tvb, 2) << 4;
payload = tvb_new_child_real_data(tvb, data, plen, plen);
+ tvb_set_free_cb(payload, g_free);
} else {
/* Last nibble doesn't need merging */
payload = tvb_new_subset(tvb, hlen, plen, -1);