From 6e1dc9027fa6b48c0102fc7e48fd1909377f4e1b Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Thu, 19 Nov 2015 16:19:36 +0100 Subject: Profinet: use pinfo pool to build conversation filter Packet pool cannot be used from GUI. Bug: 11730 Change-Id: I4f5764a38a10809373c365ecf1ea50404a15b89a Reviewed-on: https://code.wireshark.org/review/11966 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin (cherry picked from commit cf562210de8997813abf624de36a5a70d73ac421) Reviewed-on: https://code.wireshark.org/review/11969 --- plugins/profinet/packet-dcerpc-pn-io.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 7ee9610f01..022e5d8bf9 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -9676,7 +9676,7 @@ pn_io_ar_conv_filter(packet_info *pinfo) { pnio_ar_t *ar = (pnio_ar_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pn_io, 0); void* profinet_type = p_get_proto_data(pinfo->pool, pinfo, proto_pn_io, 0); - char *buf, *guid_str; + char *buf; address controllermac_addr, devicemac_addr; if ((profinet_type == NULL) || (GPOINTER_TO_UINT(profinet_type) != 10) || (ar == NULL)) { @@ -9686,15 +9686,13 @@ pn_io_ar_conv_filter(packet_info *pinfo) SET_ADDRESS(&controllermac_addr, AT_ETHER, 6, ar->controllermac); SET_ADDRESS(&devicemac_addr, AT_ETHER, 6, ar->devicemac); - guid_str = guid_to_str(wmem_packet_scope(), (const e_guid_t*) &ar->aruuid); buf = g_strdup_printf( "pn_io.ar_uuid == %s || " /* ARUUID */ "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */ "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s)", /* Alarm CR (dev -> contr) */ - guid_str, - ar->controlleralarmref, address_to_str(wmem_packet_scope(), &controllermac_addr), - ar->devicealarmref, address_to_str(wmem_packet_scope(), &devicemac_addr)); - wmem_free(NULL, guid_str); + guid_to_str(pinfo->pool, (const e_guid_t*) &ar->aruuid), + ar->controlleralarmref, address_to_str(pinfo->pool, &controllermac_addr), + ar->devicealarmref, address_to_str(pinfo->pool, &devicemac_addr)); return buf; } @@ -9713,9 +9711,9 @@ pn_io_ar_conv_data_filter(packet_info *pinfo) SET_ADDRESS(&controllermac_addr, AT_ETHER, 6, ar->controllermac); SET_ADDRESS(&devicemac_addr, AT_ETHER, 6, ar->devicemac); - controllermac_str = address_to_str(wmem_packet_scope(), &controllermac_addr); - devicemac_str = address_to_str(wmem_packet_scope(), &devicemac_addr); - guid_str = guid_to_str(wmem_packet_scope(), (const e_guid_t*) &ar->aruuid); + controllermac_str = address_to_str(pinfo->pool, &controllermac_addr); + devicemac_str = address_to_str(pinfo->pool, &devicemac_addr); + guid_str = guid_to_str(pinfo->pool, (const e_guid_t*) &ar->aruuid); if (ar->arType == 0x0010) /* IOCARSingle using RT_CLASS_3 */ { buf = g_strdup_printf( -- cgit v1.2.1