aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btrfcomm.c
diff options
context:
space:
mode:
authorVasil Velichkov <vvvelichkov@gmail.com>2018-11-04 23:03:32 +0200
committerPeter Wu <peter@lekensteyn.nl>2018-11-05 11:53:00 +0000
commitf54b6755e3d5c1f105adad38aa30d6bb6d0c31ea (patch)
tree3cd5fa836a9eaa5deb7b69b3f6d433d8e22f848d /epan/dissectors/packet-btrfcomm.c
parent83a71674a1c3edaa098934d81de1cf2052c2b740 (diff)
btrfcomm: Free uat table records
Add uat_rfcomm_channels copy and free callbacks. Change-Id: I0a778447cf32cbf73dd0d09bfdeabcc7c803f91b Reviewed-on: https://code.wireshark.org/review/30509 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/dissectors/packet-btrfcomm.c')
-rw-r--r--epan/dissectors/packet-btrfcomm.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index fe041d3985..7f018ee5b5 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -872,6 +872,26 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return offset;
}
+static void*
+uat_rfcomm_channels_copy_cb(void *dest, const void *source, size_t len _U_)
+{
+ const uat_rfcomm_channels_t* o = (const uat_rfcomm_channels_t*)source;
+ uat_rfcomm_channels_t* d = (uat_rfcomm_channels_t*)dest;
+
+ d->channel = o->channel;
+ d->payload_proto = o->payload_proto;
+ d->payload_proto_name = g_strdup(o->payload_proto_name);
+
+ return dest;
+}
+
+static void
+uat_rfcomm_channels_free_cb(void *r)
+{
+ uat_rfcomm_channels_t *rec = (uat_rfcomm_channels_t *)r;
+ g_free(rec->payload_proto_name);
+}
+
void
proto_register_btrfcomm(void)
{
@@ -1147,9 +1167,9 @@ proto_register_btrfcomm(void)
&num_rfcomm_channels,
UAT_AFFECTS_DISSECTION,
NULL,
+ uat_rfcomm_channels_copy_cb,
NULL,
- NULL,
- NULL,
+ uat_rfcomm_channels_free_cb,
NULL,
NULL,
uat_rfcomm_channels_fields);