diff options
-rw-r--r-- | plugins/irda/packet-irda.c | 10 | ||||
-rw-r--r-- | plugins/opcua/opcua_extensionobjecttable.c | 3 | ||||
-rw-r--r-- | plugins/opcua/opcua_simpletypes.c | 6 | ||||
-rw-r--r-- | plugins/profinet/packet-dcerpc-pn-io.c | 52 | ||||
-rw-r--r-- | plugins/profinet/packet-dcom-cba-acco.c | 38 | ||||
-rw-r--r-- | plugins/profinet/packet-dcom-cba.c | 4 | ||||
-rw-r--r-- | plugins/profinet/packet-pn-dcp.c | 20 | ||||
-rw-r--r-- | plugins/tpg/packet-http.c | 4 | ||||
-rw-r--r-- | plugins/unistim/packet-unistim.c | 4 | ||||
-rw-r--r-- | plugins/wimax/packet-wmx.c | 4 | ||||
-rw-r--r-- | plugins/wimaxasncp/packet-wimaxasncp.c | 4 |
11 files changed, 77 insertions, 72 deletions
diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c index 4c1e325be7..083bc499b3 100644 --- a/plugins/irda/packet-irda.c +++ b/plugins/irda/packet-irda.c @@ -34,7 +34,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/xdlc.h> #include "irda-appl.h" @@ -550,7 +550,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r } if (iap_conv->pnext == NULL) { - iap_conv->pnext = se_new(iap_conversation_t); + iap_conv->pnext = wmem_new(wmem_file_scope(), iap_conversation_t); iap_conv = iap_conv->pnext; break; } @@ -560,7 +560,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r else { conv = conversation_new(pinfo->fd->num, &srcaddr, &destaddr, PT_NONE, pinfo->srcport, pinfo->destport, 0); - iap_conv = se_new(iap_conversation_t); + iap_conv = wmem_new(wmem_file_scope(), iap_conversation_t); conversation_add_proto_data(conv, proto_iap, (void*)iap_conv); } @@ -1224,7 +1224,7 @@ void add_lmp_conversation(packet_info* pinfo, guint8 dlsap, gboolean ttp, dissec if (lmp_conv->pnext == NULL) { - lmp_conv->pnext = se_new(lmp_conversation_t); + lmp_conv->pnext = wmem_new(wmem_file_scope(), lmp_conversation_t); lmp_conv = lmp_conv->pnext; break; } @@ -1234,7 +1234,7 @@ void add_lmp_conversation(packet_info* pinfo, guint8 dlsap, gboolean ttp, dissec else { conv = conversation_new(pinfo->fd->num, &destaddr, &srcaddr, PT_NONE, dlsap, 0, NO_PORT_B); - lmp_conv = se_new(lmp_conversation_t); + lmp_conv = wmem_new(wmem_file_scope(), lmp_conversation_t); conversation_add_proto_data(conv, proto_irlmp, (void*)lmp_conv); } diff --git a/plugins/opcua/opcua_extensionobjecttable.c b/plugins/opcua/opcua_extensionobjecttable.c index 023e90a3ff..3a6403c8ea 100644 --- a/plugins/opcua/opcua_extensionobjecttable.c +++ b/plugins/opcua/opcua_extensionobjecttable.c @@ -26,6 +26,7 @@ #include <glib.h> #include <epan/packet.h> +#include <epan/wmem/wmem.h> #include "opcua_simpletypes.h" #include "opcua_complextypeparser.h" #include "opcua_extensionobjectids.h" @@ -209,7 +210,7 @@ void dispatchExtensionObjectType(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, } else { - char *szValue = ep_strdup_printf("[Invalid ByteString] Invalid length: %d", iLen); + char *szValue = wmem_strdup_printf(wmem_packet_scope(), "[Invalid ByteString] Invalid length: %d", iLen); proto_tree_add_text(tree, tvb, *pOffset, 4, "%s", szValue); } } diff --git a/plugins/opcua/opcua_simpletypes.c b/plugins/opcua/opcua_simpletypes.c index 9fca2599bd..2126ecd8b6 100644 --- a/plugins/opcua/opcua_simpletypes.c +++ b/plugins/opcua/opcua_simpletypes.c @@ -30,7 +30,7 @@ #include "opcua_simpletypes.h" #include "opcua_hfindeces.h" #include "opcua_extensionobjectids.h" -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #define DIAGNOSTICINFO_ENCODINGMASK_SYMBOLICID_FLAG 0x01 #define DIAGNOSTICINFO_ENCODINGMASK_NAMESPACE_FLAG 0x02 @@ -389,7 +389,7 @@ void parseString(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex) else { proto_item *item = proto_tree_add_item(tree, hfIndex, tvb, *pOffset, 0, ENC_NA); - szValue = ep_strdup_printf("[Invalid String] Invalid length: %d", iLen); + szValue = wmem_strdup_printf(wmem_packet_scope(), "[Invalid String] Invalid length: %d", iLen); proto_item_append_text(item, "%s", szValue); proto_item_set_end(item, tvb, *pOffset + 4); } @@ -469,7 +469,7 @@ void parseByteString(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex else { proto_item *item = proto_tree_add_item(tree, hfIndex, tvb, *pOffset, 0, ENC_NA); - szValue = ep_strdup_printf("[Invalid ByteString] Invalid length: %d", iLen); + szValue = wmem_strdup_printf(wmem_packet_scope(), "[Invalid ByteString] Invalid length: %d", iLen); proto_item_append_text(item, "%s", szValue); proto_item_set_end(item, tvb, *pOffset + 4); } diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 70d5745fd1..f54d07883b 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -51,7 +51,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/dissectors/packet-dcerpc.h> #include <epan/expert.h> #include <epan/dissector_filters.h> @@ -2679,7 +2679,7 @@ pnio_ar_new(e_uuid_t *aruuid) pnio_ar_t *ar; - ar = (pnio_ar_t *)se_alloc0(sizeof(pnio_ar_t)); + ar = (pnio_ar_t *)wmem_alloc0(wmem_file_scope(), sizeof(pnio_ar_t)); memcpy(&ar->aruuid, aruuid, sizeof(e_uuid_t)); @@ -3240,14 +3240,14 @@ dissect_IandM0_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_vendor_id_low, &u8VendorIDLow); /* c8[20] OrderID */ - pOrderID = (char *)ep_alloc(20+1); + pOrderID = (char *)wmem_alloc(wmem_packet_scope(), 20+1); tvb_memcpy(tvb, (guint8 *) pOrderID, offset, 20); pOrderID[20] = '\0'; proto_tree_add_string (tree, hf_pn_io_order_id, tvb, offset, 20, pOrderID); offset += 20; /* c8[16] IM_Serial_Number */ - pIMSerialNumber = (char *)ep_alloc(16+1); + pIMSerialNumber = (char *)wmem_alloc(wmem_packet_scope(), 16+1); tvb_memcpy(tvb, (guint8 *) pIMSerialNumber, offset, 16); pIMSerialNumber[16] = '\0'; proto_tree_add_string (tree, hf_pn_io_im_serial_number, tvb, offset, 16, pIMSerialNumber); @@ -3305,14 +3305,14 @@ dissect_IandM1_block(tvbuff_t *tvb, int offset, } /* IM_Tag_Function [32] */ - pTagFunction = (char *)ep_alloc(32+1); + pTagFunction = (char *)wmem_alloc(wmem_packet_scope(), 32+1); tvb_memcpy(tvb, (guint8 *) pTagFunction, offset, 32); pTagFunction[32] = '\0'; proto_tree_add_string (tree, hf_pn_io_im_tag_function, tvb, offset, 32, pTagFunction); offset += 32; /* IM_Tag_Location [22] */ - pTagLocation = (char *)ep_alloc(22+1); + pTagLocation = (char *)wmem_alloc(wmem_packet_scope(), 22+1); tvb_memcpy(tvb, (guint8 *) pTagLocation, offset, 22); pTagLocation[22] = '\0'; proto_tree_add_string (tree, hf_pn_io_im_tag_location, tvb, offset, 22, pTagLocation); @@ -3337,7 +3337,7 @@ dissect_IandM2_block(tvbuff_t *tvb, int offset, } /* IM_Date [16] */ - pDate = (char *)ep_alloc(16+1); + pDate = (char *)wmem_alloc(wmem_packet_scope(), 16+1); tvb_memcpy(tvb, (guint8 *) pDate, offset, 16); pDate[16] = '\0'; proto_tree_add_string (tree, hf_pn_io_im_date, tvb, offset, 16, pDate); @@ -3362,7 +3362,7 @@ dissect_IandM3_block(tvbuff_t *tvb, int offset, } /* IM_Descriptor [54] */ - pDescriptor = (char *)ep_alloc(54+1); + pDescriptor = (char *)wmem_alloc(wmem_packet_scope(), 54+1); tvb_memcpy(tvb, (guint8 *) pDescriptor, offset, 54); pDescriptor[54] = '\0'; proto_tree_add_string (tree, hf_pn_io_im_descriptor, tvb, offset, 54, pDescriptor); @@ -4319,7 +4319,7 @@ dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_length_own_port_id, &u8LengthOwnPortID); /* OwnPortID */ - pOwnPortID = (char *)ep_alloc(u8LengthOwnPortID+1); + pOwnPortID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthOwnPortID+1); tvb_memcpy(tvb, (guint8 *) pOwnPortID, offset, u8LengthOwnPortID); pOwnPortID[u8LengthOwnPortID] = '\0'; proto_tree_add_string (tree, hf_pn_io_own_port_id, tvb, offset, u8LengthOwnPortID, pOwnPortID); @@ -4337,7 +4337,7 @@ dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_length_peer_port_id, &u8LengthPeerPortID); /* PeerPortID */ - pPeerPortID = (char *)ep_alloc(u8LengthPeerPortID+1); + pPeerPortID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerPortID+1); tvb_memcpy(tvb, (guint8 *) pPeerPortID, offset, u8LengthPeerPortID); pPeerPortID[u8LengthPeerPortID] = '\0'; proto_tree_add_string (tree, hf_pn_io_peer_port_id, tvb, offset, u8LengthPeerPortID, pPeerPortID); @@ -4347,7 +4347,7 @@ dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_length_peer_chassis_id, &u8LengthPeerChassisID); /* PeerChassisID */ - pPeerChassisID = (char *)ep_alloc(u8LengthPeerChassisID+1); + pPeerChassisID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerChassisID+1); tvb_memcpy(tvb, (guint8 *) pPeerChassisID, offset, u8LengthPeerChassisID); pPeerChassisID[u8LengthPeerChassisID] = '\0'; proto_tree_add_string (tree, hf_pn_io_peer_chassis_id, tvb, offset, u8LengthPeerChassisID, pPeerChassisID); @@ -4433,7 +4433,7 @@ dissect_PDInterfaceMrpDataAdjust_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_mrp_length_domain_name, &u8LengthDomainName); /* MRP_DomainName */ - pDomainName = (char *)ep_alloc(u8LengthDomainName+1); + pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1); tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName); pDomainName[u8LengthDomainName] = '\0'; proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName); @@ -4507,7 +4507,7 @@ dissect_PDInterfaceMrpDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_mrp_length_domain_name, &u8LengthDomainName); /* MRP_DomainName */ - pDomainName = (char *)ep_alloc(u8LengthDomainName+1); + pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1); tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName); pDomainName[u8LengthDomainName] = '\0'; proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName); @@ -5087,7 +5087,7 @@ dissect_CheckPeers_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_length_peer_port_id, &u8LengthPeerPortID); /* PeerPortID */ - pPeerPortID = (char *)ep_alloc(u8LengthPeerPortID+1); + pPeerPortID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerPortID+1); tvb_memcpy(tvb, (guint8 *) pPeerPortID, offset, u8LengthPeerPortID); pPeerPortID[u8LengthPeerPortID] = '\0'; proto_tree_add_string (tree, hf_pn_io_peer_port_id, tvb, offset, u8LengthPeerPortID, pPeerPortID); @@ -5097,7 +5097,7 @@ dissect_CheckPeers_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_length_peer_chassis_id, &u8LengthPeerChassisID); /* PeerChassisID */ - pPeerChassisID = (char *)ep_alloc(u8LengthPeerChassisID+1); + pPeerChassisID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerChassisID+1); tvb_memcpy(tvb, (guint8 *) pPeerChassisID, offset, u8LengthPeerChassisID); pPeerChassisID[u8LengthPeerChassisID] = '\0'; proto_tree_add_string (tree, hf_pn_io_peer_chassis_id, tvb, offset, u8LengthPeerChassisID, pPeerChassisID); @@ -5343,7 +5343,7 @@ dissect_MrpInstanceDataAdjust_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_mrp_length_domain_name, &u8LengthDomainName); /* MRP_DomainName */ - pDomainName = (char *)ep_alloc(u8LengthDomainName+1); + pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1); tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName); pDomainName[u8LengthDomainName] = '\0'; proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName); @@ -5393,7 +5393,7 @@ dissect_MrpInstanceDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_mrp_length_domain_name, &u8LengthDomainName); /* MRP_DomainName */ - pDomainName = (char *)ep_alloc(u8LengthDomainName+1); + pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1); tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName); pDomainName[u8LengthDomainName] = '\0'; proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName); @@ -5524,7 +5524,7 @@ dissect_PDInterfaceDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_length_own_chassis_id, &u8LengthOwnChassisID); /* OwnChassisID */ - pOwnChassisID = (char *)ep_alloc(u8LengthOwnChassisID+1); + pOwnChassisID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthOwnChassisID+1); tvb_memcpy(tvb, (guint8 *) pOwnChassisID, offset, u8LengthOwnChassisID); pOwnChassisID[u8LengthOwnChassisID] = '\0'; proto_tree_add_string (tree, hf_pn_io_own_chassis_id, tvb, offset, u8LengthOwnChassisID, pOwnChassisID); @@ -5672,7 +5672,7 @@ dissect_PDSyncData_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, hf_pn_io_ptcp_length_subdomain_name, &u8LengthSubdomainName); /* PTCPSubdomainName */ - pSubdomainName = (char *)ep_alloc(u8LengthSubdomainName+1); + pSubdomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthSubdomainName+1); tvb_memcpy(tvb, (guint8 *) pSubdomainName, offset, u8LengthSubdomainName); pSubdomainName[u8LengthSubdomainName] = '\0'; proto_tree_add_string (tree, hf_pn_io_ptcp_subdomain_name, tvb, offset, u8LengthSubdomainName, pSubdomainName); @@ -6282,7 +6282,7 @@ dissect_ARData_block(tvbuff_t *tvb, int offset, hf_pn_io_cminitiator_objectuuid, &uuid); offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_station_name_length, &u16NameLength); - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (ar_tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName); @@ -6368,7 +6368,7 @@ dissect_ARData_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_station_name_length, &u16NameLength); /* ParameterServerStationName */ - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (ar_tree, hf_pn_io_parameter_server_station_name, tvb, offset, u16NameLength, pStationName); @@ -6413,7 +6413,7 @@ dissect_ARData_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_cmresponder_udprtport, &u16UDPRTPort); /* CMInitiatorStationName*/ offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_station_name_length, &u16NameLength); - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (ar_tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName); @@ -6425,7 +6425,7 @@ dissect_ARData_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_station_name_length, &u16NameLength); if (u16NameLength != 0) { /* ParameterServerStationName */ - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (ar_tree, hf_pn_io_parameter_server_station_name, tvb, offset, u16NameLength, pStationName); @@ -6820,7 +6820,7 @@ dissect_ARBlockReq_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_station_name_length, &u16NameLength); - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName); @@ -7199,7 +7199,7 @@ dissect_ARServerBlock(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_station_name_length, &u16NameLength); - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName); @@ -7295,7 +7295,7 @@ dissect_MCRBlockReq_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_station_name_length, &u16NameLength); - pStationName = (char *)ep_alloc(u16NameLength+1); + pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1); tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength); pStationName[u16NameLength] = '\0'; proto_tree_add_string (tree, hf_pn_io_provider_station_name, tvb, offset, u16NameLength, pStationName); diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index 71d5a7233a..2a4c5c52c6 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -29,7 +29,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/expert.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/addr_resolv.h> #include <epan/dissectors/packet-dcerpc.h> #include <epan/dissectors/packet-dcom.h> @@ -453,7 +453,7 @@ cba_pdev_add(packet_info *pinfo, const guint8 *ip) } /* not found, create a new */ - pdev = (cba_pdev_t *)se_alloc(sizeof(cba_pdev_t)); + pdev = (cba_pdev_t *)wmem_alloc(wmem_file_scope(), sizeof(cba_pdev_t)); memcpy( (void *) (pdev->ip), ip, 4); pdev->first_packet = pinfo->fd->num; pdev->ldevs = NULL; @@ -519,8 +519,8 @@ cba_ldev_add(packet_info *pinfo, cba_pdev_t *pdev, const char *name) } /* not found, create a new */ - ldev = (cba_ldev_t *)se_alloc(sizeof(cba_ldev_t)); - ldev->name = se_strdup(name); + ldev = (cba_ldev_t *)wmem_alloc(wmem_file_scope(), sizeof(cba_ldev_t)); + ldev->name = wmem_strdup(wmem_file_scope(), name); ldev->first_packet = pinfo->fd->num; ldev->ldev_object = NULL; ldev->acco_object = NULL; @@ -694,7 +694,7 @@ cba_frame_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ld } } - frame = (cba_frame_t *)se_alloc(sizeof(cba_frame_t)); + frame = (cba_frame_t *)wmem_alloc(wmem_file_scope(), sizeof(cba_frame_t)); frame->consparent = cons_ldev; frame->provparent = prov_ldev; @@ -927,7 +927,7 @@ cba_connection_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *pr } } - conn = (cba_connection_t *)se_alloc(sizeof(cba_connection_t)); + conn = (cba_connection_t *)wmem_alloc(wmem_file_scope(), sizeof(cba_connection_t)); conn->consparentacco = cons_ldev; conn->provparentacco = prov_ldev; @@ -940,7 +940,7 @@ cba_connection_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *pr conn->packet_last = 0; conn->consid = consid; - conn->provitem = se_strdup(provitem); + conn->provitem = wmem_strdup(wmem_file_scope(), provitem); conn->typedesclen = typedesclen; conn->typedesc = typedesc; conn->qostype = qostype; @@ -1287,7 +1287,7 @@ dissect_ICBAAccoServer_Connect_rqst(tvbuff_t *tvb, int offset, /* link connections infos to the call */ if (prov_ldev != NULL && cons_ldev != NULL) { - call = (server_connect_call_t *)se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); + call = (server_connect_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); call->conn_count = 0; call->frame = NULL; call->conns = (cba_connection_t **) (call+1); @@ -1336,7 +1336,7 @@ dissect_ICBAAccoServer_Connect_rqst(tvbuff_t *tvb, int offset, conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL, u16QoSType, u16QoSValue, szItem, u32ConsID, 0, /* XXX - VarType must be translated to new type description if it includes an array (0x2000) */ - (guint16 *)se_memdup(&u16VarType, 2), 1); + (guint16 *)wmem_memdup(wmem_file_scope(), &u16VarType, 2), 1); cba_connection_info(tvb, pinfo, sub_tree, conn); } else { @@ -1447,7 +1447,7 @@ dissect_ICBAAccoServer2_Connect2_rqst(tvbuff_t *tvb, int offset, /* link connection infos to the call */ if (prov_ldev != NULL && cons_ldev != NULL) { - call = (server_connect_call_t *)se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); + call = (server_connect_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); call->conn_count = 0; call->frame = NULL; call->conns = (cba_connection_t **) (call+1); @@ -1489,7 +1489,7 @@ dissect_ICBAAccoServer2_Connect2_rqst(tvbuff_t *tvb, int offset, /* limit the allocation to a reasonable size */ if (u32ArraySize2 < 1000) { - typedesc = (guint16 *)se_alloc0(u32ArraySize2 * 2); + typedesc = (guint16 *)wmem_alloc0(wmem_file_scope(), u32ArraySize2 * 2); typedesclen = u32ArraySize2; } else { typedesc = NULL; @@ -1682,7 +1682,7 @@ dissect_ICBAAccoServer_Disconnect_rqst(tvbuff_t *tvb, int offset, /* link connection infos to the call */ if (prov_ldev != NULL) { - call = (server_connect_call_t *)se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); + call = (server_connect_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); call->conn_count = 0; call->frame = NULL; call->conns = (cba_connection_t **) (call+1); @@ -1842,7 +1842,7 @@ dissect_ICBAAccoServer_DisconnectMe_rqst(tvbuff_t *tvb, int offset, cons_ldev = cba_acco_add(pinfo, szStr); if (prov_ldev != NULL && cons_ldev != NULL) { - call = (server_disconnectme_call_t *)se_alloc(sizeof(server_disconnectme_call_t)); + call = (server_disconnectme_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_disconnectme_call_t)); call->cons = cons_ldev; call->prov = prov_ldev; info->call_data->private_data = call; @@ -1915,7 +1915,7 @@ dissect_ICBAAccoServerSRT_DisconnectMe_rqst(tvbuff_t *tvb, int offset, cons_ldev = cba_acco_add(pinfo, szStr); if (prov_ldev != NULL && cons_ldev != NULL) { - call = (server_disconnectme_call_t *)se_alloc(sizeof(server_disconnectme_call_t)); + call = (server_disconnectme_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_disconnectme_call_t)); call->cons = cons_ldev; call->prov = prov_ldev; info->call_data->private_data = call; @@ -2178,7 +2178,7 @@ dissect_ICBAAccoServerSRT_ConnectCR_rqst(tvbuff_t *tvb, int offset, /* link frame infos to the call */ if (prov_ldev != NULL && cons_ldev != NULL && u32ArraySize < 100) { - call = (server_frame_call_t *)se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *)); + call = (server_frame_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *)); call->frame_count = 0; call->frames = (cba_frame_t **) (call+1); info->call_data->private_data = call; @@ -2366,7 +2366,7 @@ dissect_ICBAAccoServerSRT_DisconnectCR_rqst(tvbuff_t *tvb, int offset, /* link frame infos to the call */ if (prov_ldev != NULL) { - call = (server_frame_call_t *)se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *)); + call = (server_frame_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *)); call->frame_count = 0; call->frames = (cba_frame_t **) (call+1); info->call_data->private_data = call; @@ -2519,7 +2519,7 @@ dissect_ICBAAccoServerSRT_Connect_rqst(tvbuff_t *tvb, int offset, /* link connections infos to the call */ if (frame != NULL) { - call = (server_connect_call_t *)se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); + call = (server_connect_call_t *)wmem_alloc(wmem_file_scope(), sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *)); call->conn_count = 0; call->frame = frame; call->conns = (cba_connection_t **) (call+1); @@ -2559,7 +2559,7 @@ dissect_ICBAAccoServerSRT_Connect_rqst(tvbuff_t *tvb, int offset, u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep, &u32ArraySize2); - typedesc = (guint16 *)se_alloc0(u32ArraySize2 * 2); + typedesc = (guint16 *)wmem_alloc0(wmem_file_scope(), u32ArraySize2 * 2); typedesclen = u32ArraySize2; /* extended type description will build an array here */ @@ -3322,7 +3322,7 @@ dissect_ICBAAccoServer2_GetConnectionData_rqst(tvbuff_t *tvb, int offset, /* link ldev to the call */ if (cons_ldev != NULL) { - call = (cba_ldev_t **)se_alloc(sizeof(cba_ldev_t *)); + call = (cba_ldev_t **)wmem_alloc(wmem_file_scope(), sizeof(cba_ldev_t *)); *call = cons_ldev; info->call_data->private_data = call; } diff --git a/plugins/profinet/packet-dcom-cba.c b/plugins/profinet/packet-dcom-cba.c index 4d271acbbc..e99014d827 100644 --- a/plugins/profinet/packet-dcom-cba.c +++ b/plugins/profinet/packet-dcom-cba.c @@ -26,7 +26,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/expert.h> #include <epan/dissectors/packet-dcerpc.h> #include <epan/dissectors/packet-dcom.h> @@ -571,7 +571,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, } if (strlen(szStr) > 0) { - call = se_strdup(szStr); + call = wmem_strdup(wmem_file_scope(), szStr); info->call_data->private_data = call; } diff --git a/plugins/profinet/packet-pn-dcp.c b/plugins/profinet/packet-pn-dcp.c index bd0d6d9207..045e9cce23 100644 --- a/plugins/profinet/packet-pn-dcp.c +++ b/plugins/profinet/packet-pn-dcp.c @@ -29,7 +29,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/expert.h> #include <epan/dissectors/packet-dcerpc.h> @@ -467,7 +467,7 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo, switch (suboption) { case PNDCP_SUBOPTION_DEVICE_MANUF: - typeofstation = (char *)ep_alloc(block_length+1); + typeofstation = (char *)wmem_alloc(wmem_packet_scope(), block_length+1); tvb_memcpy(tvb, (guint8 *) typeofstation, offset, block_length); typeofstation[block_length] = '\0'; proto_tree_add_string (tree, hf_pn_dcp_suboption_device_typeofstation, tvb, offset, block_length, typeofstation); @@ -485,11 +485,11 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo, offset += block_length; break; case PNDCP_SUBOPTION_DEVICE_NAMEOFSTATION: - nameofstation = (char *)ep_alloc(block_length+1); + nameofstation = (char *)wmem_alloc(wmem_packet_scope(), block_length+1); tvb_memcpy(tvb, (guint8 *) nameofstation, offset, block_length); nameofstation[block_length] = '\0'; proto_tree_add_string (tree, hf_pn_dcp_suboption_device_nameofstation, tvb, offset, block_length, nameofstation); - pn_append_info(pinfo, dcp_item, ep_strdup_printf(", NameOfStation:\"%s\"", nameofstation)); + pn_append_info(pinfo, dcp_item, wmem_strdup_printf(wmem_packet_scope(), ", NameOfStation:\"%s\"", nameofstation)); proto_item_append_text(block_item, "Device/NameOfStation"); if (have_block_qualifier) { proto_item_append_text(block_item, ", BlockQualifier: %s", @@ -538,7 +538,7 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item_append_text(block_item, ", PN-Supervisor"); break; case PNDCP_SUBOPTION_DEVICE_DEV_OPTIONS: - info_str = ep_strdup_printf(", Dev-Options(%u)", block_length/2); + info_str = wmem_strdup_printf(wmem_packet_scope(), ", Dev-Options(%u)", block_length/2); pn_append_info(pinfo, dcp_item, info_str); proto_item_append_text(block_item, "Device/Device Options"); if (have_block_qualifier) { @@ -556,11 +556,11 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo, } break; case PNDCP_SUBOPTION_DEVICE_ALIAS_NAME: - aliasname = (char *)ep_alloc(block_length+1); + aliasname = (char *)wmem_alloc(wmem_packet_scope(), block_length+1); tvb_memcpy(tvb, (guint8 *) aliasname, offset, block_length); aliasname[block_length] = '\0'; proto_tree_add_string (tree, hf_pn_dcp_suboption_device_aliasname, tvb, offset, block_length, aliasname); - pn_append_info(pinfo, dcp_item, ep_strdup_printf(", AliasName:\"%s\"", aliasname)); + pn_append_info(pinfo, dcp_item, wmem_strdup_printf(wmem_packet_scope(), ", AliasName:\"%s\"", aliasname)); proto_item_append_text(block_item, "Device/AliasName"); if (have_block_qualifier) { proto_item_append_text(block_item, ", BlockQualifier: %s", @@ -702,8 +702,8 @@ dissect_PNDCP_Suboption_Control(tvbuff_t *tvb, int offset, packet_info *pinfo, expert_add_info_format(pinfo, item, &ei_pn_dcp_block_error_unknown, "%s", val_to_str(block_error, pn_dcp_block_error, "Unknown")); } - info_str = ep_strdup_printf(", Response(%s)", - val_to_str(block_error, pn_dcp_block_error, "Unknown")); + info_str = wmem_strdup_printf(wmem_packet_scope(), ", Response(%s)", + val_to_str(block_error, pn_dcp_block_error, "Unknown")); pn_append_info(pinfo, dcp_item, info_str); proto_item_append_text(block_item, ", BlockError: %s", val_to_str(block_error, pn_dcp_block_error, "Unknown")); @@ -934,7 +934,7 @@ dissect_PNDCP_PDU(tvbuff_t *tvb, return; } - xid_str = ep_strdup_printf(", Xid:0x%x", xid); + xid_str = wmem_strdup_printf(wmem_packet_scope(), ", Xid:0x%x", xid); pn_append_info(pinfo, dcp_item, xid_str); /* dissect a number of blocks (depending on the remaining length) */ diff --git a/plugins/tpg/packet-http.c b/plugins/tpg/packet-http.c index b15219892d..9d6d4a5788 100644 --- a/plugins/tpg/packet-http.c +++ b/plugins/tpg/packet-http.c @@ -23,6 +23,8 @@ #include "config.h" +#include <epan/wmem/wmem.h> + #include "http-parser.h" #include <gmodule.h> @@ -47,7 +49,7 @@ static int hf_http_request_uri = -1; static dissector_handle_t http_handle; static void dissect_http(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree) { - http_info_value_t* msgdata = ep_alloc0(sizeof(http_info_value_t)); + http_info_value_t* msgdata = wmem_alloc0(wmem_packet_scope(), sizeof(http_info_value_t)); tvbparse_elem_t* reqresp; tpg_parser_data_t* tpg; proto_item* pi = proto_tree_add_item(tree,proto_http,tvb,0,-1,ENC_NA); diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index 088a5e83e3..a333ecc51c 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -29,7 +29,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/tap.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/expert.h> #include <epan/address.h> #include <epan/prefs.h> @@ -225,7 +225,7 @@ dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree,void *data _U_ proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,ENC_BIG_ENDIAN); /* Allocate new mem for queueing */ - uinfo = (unistim_info_t *)se_alloc(sizeof(unistim_info_t)); + uinfo = (unistim_info_t *)wmem_alloc(wmem_packet_scope(), sizeof(unistim_info_t)); /* Clear tap struct */ uinfo->rudp_type = 0; diff --git a/plugins/wimax/packet-wmx.c b/plugins/wimax/packet-wmx.c index 76c37b24d0..15a3ae6d49 100644 --- a/plugins/wimax/packet-wmx.c +++ b/plugins/wimax/packet-wmx.c @@ -35,7 +35,7 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/address.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include "wimax_tlv.h" #include "wimax_bits.h" @@ -738,7 +738,7 @@ proto_tree *add_protocol_subtree(tlv_info_t *self, gint idx, proto_tree *tree, i /* display the TLV name and display the value in hex. Highlight type, length, and value. */ va_start(ap, format); - message = se_strdup_vprintf(format, ap); + message = wmem_strdup_vprintf(wmem_packet_scope(), format, ap); va_end(ap); tlv_item = proto_tree_add_protocol_format(tree, hfindex, tvb, start, length, "%s", message); diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c index 668ab5a366..e090ade775 100644 --- a/plugins/wimaxasncp/packet-wimaxasncp.c +++ b/plugins/wimaxasncp/packet-wimaxasncp.c @@ -3287,13 +3287,15 @@ register_wimaxasncp_fields(const char* unused _U_) debug_parser = getenv("WIRESHARK_DEBUG_WIMAXASNCP_DICT_PARSER") != NULL; dump_dict = getenv("WIRESHARK_DUMP_WIMAXASNCP_DICT") != NULL; - dir = ep_strdup_printf( + dir = g_strdup_printf( "%s" G_DIR_SEPARATOR_S "wimaxasncp", get_datafile_dir()); wimaxasncp_dict = wimaxasncp_dict_scan(dir, "dictionary.xml", debug_parser, &dict_error); + g_free(dir); + if (dict_error) { report_failure("wimaxasncp - %s", dict_error); |