diff --git a/epan/dissectors/packet-sametime.c b/epan/dissectors/packet-sametime.c index a70e73c68f..1bc9eee101 100644 --- a/epan/dissectors/packet-sametime.c +++ b/epan/dissectors/packet-sametime.c @@ -26,6 +26,7 @@ #include "config.h" #include +#include #include #include #include @@ -529,7 +530,7 @@ dissect_sametime_content(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_append_str(pinfo->cinfo, COL_INFO, " "); /* message type statistic */ - sinfo = ep_new(struct SametimeTap); + sinfo = wmem_new(wmem_packet_scope(), struct SametimeTap); sinfo->message_type = message_type; sinfo->send_type = -1; sinfo->user_status = -1; diff --git a/epan/dissectors/packet-sasp.c b/epan/dissectors/packet-sasp.c index ed385eb88b..64b528708e 100644 --- a/epan/dissectors/packet-sasp.c +++ b/epan/dissectors/packet-sasp.c @@ -26,6 +26,7 @@ #include "config.h" #include +#include #include #include #include "packet-tcp.h" @@ -527,7 +528,7 @@ static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offse proto_tree *dereg_req_data; guint8 reason_flag; static gboolean first_flag = TRUE; - emem_strbuf_t *reasonflags_strbuf = ep_strbuf_new_label(""); + wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_new_label(wmem_packet_scope()); static const gchar *fstr[] = {"No Reason", "Learned & Purposeful" }; dereg_tree = proto_tree_add_text(pay_load, tvb, offset, -1 , "DeReg Request"); @@ -542,19 +543,19 @@ static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offse offset += 1; /* Reason */ - ep_strbuf_truncate(reasonflags_strbuf, 0); + wmem_strbuf_truncate(reasonflags_strbuf, 0); reason_flag = tvb_get_guint8(tvb, offset); if ((reason_flag & SASP_DEREG_REQ_REASON_LEARNED) == 0) - ep_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[0]); + wmem_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[0]); else - ep_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[1]); + wmem_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[1]); first_flag = FALSE; /*dereg_req_reason_flag =*/ proto_tree_add_uint_format(dereg_req_data, hf_dereg_req_reason_flag, tvb, offset, 1, reason_flag, "Reason: 0x%02x (%s)", reason_flag, - reasonflags_strbuf->str); + wmem_strbuf_get_str(reasonflags_strbuf)); #if 0 /* XXX: ToDo?? Flags to be displayed under a subtree ? */ dereg_req_reason_flag_tree = proto_item_add_subtree(dereg_req_reason_flag, ett_dereg_req_reason_flag); #endif diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c index f67276a507..acc733dd45 100644 --- a/epan/dissectors/packet-sbus.c +++ b/epan/dissectors/packet-sbus.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include /* Attribute values*/ @@ -711,10 +711,10 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ sbus_attribut = tvb_get_guint8(tvb,8); if ( !request_val && sbus_attribut == 0 ) {/* request telegram */ - new_request_key = se_new(sbus_request_key); + new_request_key = wmem_new(wmem_file_scope(), sbus_request_key); *new_request_key = request_key; - request_val = se_new(sbus_request_val); + request_val = wmem_new(wmem_file_scope(), sbus_request_val); request_val->cmd_code=tvb_get_guint8(tvb,10); request_val->retry_count=0; request_val->req_frame = pinfo->fd->num; /*store actual frame nr.*/ diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index 16dc15e690..e6008fecc3 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -85,7 +85,7 @@ #include #include #include -#include +#include #include #include #include @@ -5100,7 +5100,7 @@ dissect_scsi_rsp(tvbuff_t *tvb, packet_info *pinfo, cmdset_t *csdata; scsi_task_data_t *cdata; - cdata = ep_new(scsi_task_data_t); + cdata = wmem_new(wmem_packet_scope(), scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_RSP; @@ -5160,7 +5160,7 @@ dissect_scsi_snsinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const char *old_proto; scsi_task_data_t *cdata; - cdata = ep_new(scsi_task_data_t); + cdata = wmem_new(wmem_packet_scope(), scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_SNS; @@ -5505,7 +5505,7 @@ dissect_scsi_cdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* make sure no one will overwrite this in the info column */ col_set_fence(pinfo->cinfo, COL_INFO); - cdata = ep_new(scsi_task_data_t); + cdata = wmem_new(wmem_packet_scope(), scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_CDB; @@ -5586,7 +5586,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } payload_len = tvb_length(tvb); - cdata = ep_new(scsi_task_data_t); + cdata = wmem_new(wmem_packet_scope(), scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; cdata->type = SCSI_PDU_TYPE_CDB; @@ -5783,7 +5783,7 @@ get_cmdset_data(itlq_nexus_t *itlq, itl_nexus_t *itl) cmdset = scsi_def_devtype; } - csdata = ep_new(cmdset_t); + csdata = wmem_new(wmem_packet_scope(), cmdset_t); switch(cmdset&SCSI_CMDSET_MASK) { case SCSI_DEV_SBC: diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c index 6102410af0..fac7941d42 100644 --- a/epan/dissectors/packet-ses.c +++ b/epan/dissectors/packet-ses.c @@ -29,19 +29,18 @@ #include +#include #include #include #include #include #include #include +#include #include "packet-ber.h" #include "packet-ses.h" -/* #include */ -#include -#include /* ses header fields */ static int proto_ses = -1; @@ -1092,7 +1091,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, pres_ctx_id = (guint32 *)p_get_proto_data (pinfo->fd, proto_ses, 0); if (ses_rtse_reassemble != 0 && !pres_ctx_id) { /* First time visited - save pres_ctx_id */ - pres_ctx_id = se_new(guint32); + pres_ctx_id = wmem_new(wmem_file_scope(), guint32); *pres_ctx_id = ses_pres_ctx_id; p_add_proto_data (pinfo->fd, proto_ses, 0, pres_ctx_id); } diff --git a/epan/dissectors/packet-sita.c b/epan/dissectors/packet-sita.c index c911bb752c..5878c3d06c 100644 --- a/epan/dissectors/packet-sita.c +++ b/epan/dissectors/packet-sita.c @@ -35,7 +35,7 @@ #include #include -#include +#include static dissector_table_t sita_dissector_table; static dissector_handle_t data_handle; @@ -75,27 +75,27 @@ static int hf_dcd = -1; #define IOP "Local" #define REMOTE "Remote" -static gchar * +static const gchar * format_flags_string(guchar value, const gchar *array[]) { int i; guint bpos; - emem_strbuf_t *buf; + wmem_strbuf_t *buf; const char *sep = ""; - buf = ep_strbuf_sized_new(MAX_FLAGS_LEN, MAX_FLAGS_LEN); + buf = wmem_strbuf_sized_new(wmem_packet_scope(), MAX_FLAGS_LEN, MAX_FLAGS_LEN); for (i = 0; i < 8; i++) { bpos = 1 << i; if (value & bpos) { if (array[i][0]) { /* there is a string to emit... */ - ep_strbuf_append_printf(buf, "%s%s", sep, + wmem_strbuf_append_printf(buf, "%s%s", sep, array[i]); sep = ", "; } } } - return buf->str; + return wmem_strbuf_get_str(buf); } static void @@ -103,7 +103,7 @@ dissect_sita(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti; guchar flags, signals, errors1, errors2, proto; - gchar *errors1_string, *errors2_string, *signals_string, *flags_string; + const gchar *errors1_string, *errors2_string, *signals_string, *flags_string; proto_tree *sita_tree = NULL; proto_tree *sita_flags_tree = NULL; proto_tree *sita_errors1_tree = NULL; diff --git a/epan/dissectors/packet-skype.c b/epan/dissectors/packet-skype.c index 2b67ed40e2..9fb9cb6af3 100644 --- a/epan/dissectors/packet-skype.c +++ b/epan/dissectors/packet-skype.c @@ -43,6 +43,7 @@ #include "config.h" #include +#include #include #include @@ -176,7 +177,7 @@ dissect_skype_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) skype_udp_info = (skype_udp_conv_info_t *)conversation_get_proto_data(conversation, proto_skype); if (!skype_udp_info) { /* new conversation create local data structure */ - skype_udp_info = se_new(skype_udp_conv_info_t); + skype_udp_info = wmem_new(wmem_file_scope(), skype_udp_conv_info_t); skype_udp_info->global_src_ip = 0; skype_udp_info->global_dst_ip = 0; conversation_add_proto_data(conversation, proto_skype, diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c index 7e78c6afba..b44e0e6f2c 100644 --- a/epan/dissectors/packet-smpp.c +++ b/epan/dissectors/packet-smpp.c @@ -62,7 +62,7 @@ #include #include -#include +#include #include "packet-tcp.h" #include "packet-smpp.h" @@ -1555,7 +1555,7 @@ smpp_handle_tlv(proto_tree *tree, tvbuff_t *tvb, int *offset) field = tvb_get_guint8(tvb, *offset); minor = field & 0x0F; major = (field & 0xF0) >> 4; - strval=ep_strdup_printf("%u.%u", major, minor); + strval=wmem_strdup_printf(wmem_packet_scope(), "%u.%u", major, minor); proto_tree_add_string(sub_tree, hf_smpp_SC_interface_version, tvb, *offset, 1, strval); (*offset)++; @@ -1886,7 +1886,7 @@ bind_receiver(proto_tree *tree, tvbuff_t *tvb) field = tvb_get_guint8(tvb, offset++); minor = field & 0x0F; major = (field & 0xF0) >> 4; - strval=ep_strdup_printf("%u.%u", major, minor); + strval=wmem_strdup_printf(wmem_packet_scope(), "%u.%u", major, minor); proto_tree_add_string(tree, hf_smpp_interface_version, tvb, offset - 1, 1, strval); smpp_handle_int1(tree, tvb, hf_smpp_addr_ton, &offset); @@ -2464,8 +2464,8 @@ dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (command_status_str == NULL) { /* Check if the reserved value is in the vendor-specific range. */ command_status_str = (command_status >= 0x400 && command_status <= 0x4FF ? - ep_strdup_printf("Vendor-specific Error (0x%08X)", command_status) : - ep_strdup_printf("(Reserved Error 0x%08X)", command_status)); + wmem_strdup_printf(wmem_packet_scope(), "Vendor-specific Error (0x%08X)", command_status) : + wmem_strdup_printf(wmem_packet_scope(), "(Reserved Error 0x%08X)", command_status)); } } offset += 4; @@ -2719,7 +2719,7 @@ dissect_smpp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* if (tree || (command_id == 4)) */ /* Queue packet for Tap */ - tap_rec = ep_new0(smpp_tap_rec_t); + tap_rec = wmem_new0(wmem_packet_scope(), smpp_tap_rec_t); tap_rec->command_id = command_id; tap_rec->command_status = command_status; tap_queue_packet(smpp_tap, pinfo, tap_rec); diff --git a/epan/dissectors/packet-ssh.c b/epan/dissectors/packet-ssh.c index bc4fb3c2f8..5d98827c98 100644 --- a/epan/dissectors/packet-ssh.c +++ b/epan/dissectors/packet-ssh.c @@ -55,7 +55,7 @@ #include #include -#include +#include #include #include #include @@ -338,7 +338,7 @@ dissect_ssh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) global_data = (struct ssh_flow_data *)conversation_get_proto_data(conversation, proto_ssh); if (!global_data) { - global_data = (struct ssh_flow_data *)se_alloc0(sizeof(struct ssh_flow_data)); + global_data = (struct ssh_flow_data *)wmem_alloc0(wmem_file_scope(), sizeof(struct ssh_flow_data)); global_data->version=SSH_VERSION_UNKNOWN; global_data->kex_specific_dissector=ssh_dissect_kex_dh; global_data->peer_data[CLIENT_PEER_DATA].mac_length=-1; @@ -439,26 +439,26 @@ ssh_dissect_ssh2(tvbuff_t *tvb, packet_info *pinfo, struct ssh_peer_data *peer_data = &global_data->peer_data[is_response]; if (tree) { - emem_strbuf_t *title=ep_strbuf_new("SSH Version 2"); + wmem_strbuf_t *title=wmem_strbuf_new(wmem_packet_scope(), "SSH Version 2"); if (peer_data->enc || peer_data->mac || peer_data->comp) { - ep_strbuf_append_printf(title, " ("); + wmem_strbuf_append_printf(title, " ("); if (peer_data->enc) - ep_strbuf_append_printf(title, "encryption:%s%s", + wmem_strbuf_append_printf(title, "encryption:%s%s", peer_data->enc, peer_data->mac || peer_data->comp ? " " : ""); if (peer_data->mac) - ep_strbuf_append_printf(title, "mac:%s%s", + wmem_strbuf_append_printf(title, "mac:%s%s", peer_data->mac, peer_data->comp ? " " : ""); if (peer_data->comp) - ep_strbuf_append_printf(title, "compression:%s", + wmem_strbuf_append_printf(title, "compression:%s", peer_data->comp); - ep_strbuf_append_printf(title, ")"); + wmem_strbuf_append_printf(title, ")"); } - ti=proto_tree_add_text(tree, tvb, offset, -1, "%s", title->str); + ti=proto_tree_add_text(tree, tvb, offset, -1, "%s", wmem_strbuf_get_str(title)); ssh2_tree = proto_item_add_subtree(ti, ett_ssh2); } @@ -984,7 +984,7 @@ ssh_choose_algo(gchar *client, gchar *server, gchar **result) for (step = client_strings; *step; step++) { GSList *agreed; if ((agreed=g_slist_find_custom(server_list, *step, ssh_gslist_compare_strings))) { - *result = se_strdup((const gchar *)agreed->data); + *result = wmem_strdup(wmem_file_scope(), (const gchar *)agreed->data); break; } } diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c index 801d2b46ca..b1ab50b26c 100644 --- a/epan/dissectors/packet-ssl.c +++ b/epan/dissectors/packet-ssl.c @@ -96,6 +96,7 @@ #include #include #include +#include #include #include #include diff --git a/epan/dissectors/packet-sysex.c b/epan/dissectors/packet-sysex.c index b1230da3f0..ea2911542f 100644 --- a/epan/dissectors/packet-sysex.c +++ b/epan/dissectors/packet-sysex.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -954,7 +954,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset, if (conv_data == NULL) { - conv_data = se_new(digitech_conv_data_t); + conv_data = wmem_new(wmem_file_scope(), digitech_conv_data_t); conv_data->protocol_version = 1; /* Default to version 1 */ }