emem -> wmem (except uat or init routines)

svn path=/trunk/; revision=52087
This commit is contained in:
Pascal Quantin 2013-09-15 21:36:37 +00:00
parent da27bad13b
commit da8240ef60
14 changed files with 116 additions and 107 deletions

View File

@ -45,6 +45,7 @@
#include <epan/packet.h> #include <epan/packet.h>
#include <epan/prefs.h> #include <epan/prefs.h>
#include <epan/expert.h> #include <epan/expert.h>
#include <epan/wmem/wmem.h>
#include "packet-rmt-common.h" #include "packet-rmt-common.h"
@ -119,7 +120,7 @@ void fec_decode_ext_fti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
instance_id = (guint8) tvb_get_ntohs(tvb, offset+8); instance_id = (guint8) tvb_get_ntohs(tvb, offset+8);
/* Decode FEC Instance ID */ /* Decode FEC Instance ID */
fec_data = se_new0(fec_packet_data_t); fec_data = wmem_new0(wmem_file_scope(), fec_packet_data_t);
fec_data->instance_id = instance_id; fec_data->instance_id = instance_id;
p_add_proto_data(pinfo->fd, proto_rmt_fec, 0, fec_data); p_add_proto_data(pinfo->fd, proto_rmt_fec, 0, fec_data);

View File

@ -47,6 +47,7 @@
#include <epan/packet.h> #include <epan/packet.h>
#include <epan/prefs.h> #include <epan/prefs.h>
#include <epan/expert.h> #include <epan/expert.h>
#include <epan/wmem/wmem.h>
#include "packet-rmt-common.h" #include "packet-rmt-common.h"
@ -251,7 +252,7 @@ static guint dissect_feccode(proto_tree *tree,
guint8 encoding_id = tvb_get_guint8(tvb, offset); guint8 encoding_id = tvb_get_guint8(tvb, offset);
/* Save encoding ID */ /* Save encoding ID */
norm_data = se_new0(norm_packet_data_t); norm_data = wmem_new0(wmem_file_scope(), norm_packet_data_t);
norm_data->encoding_id = encoding_id; norm_data->encoding_id = encoding_id;
p_add_proto_data(pinfo->fd, proto_rmt_norm, 0, norm_data); p_add_proto_data(pinfo->fd, proto_rmt_norm, 0, norm_data);
@ -385,7 +386,7 @@ static void dissect_norm_info(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv
offset++; offset++;
/* Save encoding ID */ /* Save encoding ID */
norm_data = se_new0(norm_packet_data_t); norm_data = wmem_new0(wmem_file_scope(), norm_packet_data_t);
norm_data->encoding_id = tvb_get_guint8(tvb, offset); norm_data->encoding_id = tvb_get_guint8(tvb, offset);
p_add_proto_data(pinfo->fd, proto_rmt_norm, 0, norm_data); p_add_proto_data(pinfo->fd, proto_rmt_norm, 0, norm_data);

View File

@ -43,6 +43,7 @@
#include <epan/prefs.h> #include <epan/prefs.h>
#include <epan/to_str.h> #include <epan/to_str.h>
#include <epan/expert.h> #include <epan/expert.h>
#include <epan/wmem/wmem.h>
#include <wiretap/wtap.h> #include <wiretap/wtap.h>
@ -736,7 +737,7 @@ dissect_rpcap_startcap_request (tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item (field_tree, hf_flags_outbound, tvb, offset, 2, ENC_BIG_ENDIAN); proto_tree_add_item (field_tree, hf_flags_outbound, tvb, offset, 2, ENC_BIG_ENDIAN);
if (flags & 0x1F) { if (flags & 0x1F) {
gchar *flagstr = ep_strdup_printf ("%s%s%s%s%s", gchar *flagstr = wmem_strdup_printf (wmem_packet_scope(), "%s%s%s%s%s",
(flags & FLAG_PROMISC) ? ", Promiscuous" : "", (flags & FLAG_PROMISC) ? ", Promiscuous" : "",
(flags & FLAG_DGRAM) ? ", Datagram" : "", (flags & FLAG_DGRAM) ? ", Datagram" : "",
(flags & FLAG_SERVEROPEN) ? ", ServerOpen" : "", (flags & FLAG_SERVEROPEN) ? ", ServerOpen" : "",

View File

@ -328,7 +328,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* info column of the entire conversation * info column of the entire conversation
*/ */
if(!hash_info->command){ if(!hash_info->command){
hash_info->command=se_strdup((gchar*)field_stringz); hash_info->command=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz);
} }
} else { } else {

View File

@ -33,7 +33,7 @@
#include <epan/packet.h> #include <epan/packet.h>
#include <epan/strutil.h> #include <epan/strutil.h>
#include <epan/conversation.h> #include <epan/conversation.h>
#include <epan/wmem/wmem.h>
#include <epan/prefs.h> #include <epan/prefs.h>
#define RSYNCD_MAGIC_HEADER "@RSYNCD:" #define RSYNCD_MAGIC_HEADER "@RSYNCD:"
@ -135,7 +135,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_data = (struct rsync_conversation_data *)conversation_get_proto_data(conversation, proto_rsync); conversation_data = (struct rsync_conversation_data *)conversation_get_proto_data(conversation, proto_rsync);
if (conversation_data == NULL) { /* new conversation */ if (conversation_data == NULL) { /* new conversation */
conversation_data = se_new(struct rsync_conversation_data); conversation_data = wmem_new(wmem_file_scope(), struct rsync_conversation_data);
conversation_data->client_state = RSYNC_INIT; conversation_data->client_state = RSYNC_INIT;
conversation_data->server_state = RSYNC_SERV_INIT; conversation_data->server_state = RSYNC_SERV_INIT;
conversation_add_proto_data(conversation, proto_rsync, conversation_data); conversation_add_proto_data(conversation, proto_rsync, conversation_data);
@ -150,7 +150,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
rsync_frame_data_p = (struct rsync_frame_data *)p_get_proto_data(pinfo->fd, proto_rsync, 0); rsync_frame_data_p = (struct rsync_frame_data *)p_get_proto_data(pinfo->fd, proto_rsync, 0);
if (!rsync_frame_data_p) { if (!rsync_frame_data_p) {
/* then we haven't seen this frame before */ /* then we haven't seen this frame before */
rsync_frame_data_p = se_new(struct rsync_frame_data); rsync_frame_data_p = wmem_new(wmem_file_scope(), struct rsync_frame_data);
rsync_frame_data_p->state = (me == SERVER) ? conversation_data->server_state : conversation_data->client_state; rsync_frame_data_p->state = (me == SERVER) ? conversation_data->server_state : conversation_data->client_state;
p_add_proto_data(pinfo->fd, proto_rsync, 0, rsync_frame_data_p); p_add_proto_data(pinfo->fd, proto_rsync, 0, rsync_frame_data_p);
} }

View File

@ -57,6 +57,7 @@
#include <epan/expert.h> #include <epan/expert.h>
#include <epan/prefs.h> #include <epan/prefs.h>
#include <epan/addr_resolv.h> #include <epan/addr_resolv.h>
#include <epan/wmem/wmem.h>
#include "packet-rtps.h" #include "packet-rtps.h"
@ -1687,7 +1688,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
*/ */
/* Calc indent string */ /* Calc indent string */
indent_string = (char *)ep_alloc((indent_level*2)+1); indent_string = (char *)wmem_alloc(wmem_epan_scope(), (indent_level*2)+1);
memset(indent_string, ' ', indent_level*2); memset(indent_string, ' ', indent_level*2);
indent_string[indent_level*2] = '\0'; indent_string[indent_level*2] = '\0';
@ -2179,10 +2180,10 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
/* Array print */ /* Array print */
if (arr_dimension != NULL) { if (arr_dimension != NULL) {
/* Printing an array */ /* Printing an array */
emem_strbuf_t *dim_str = ep_strbuf_new_label(NULL); wmem_strbuf_t *dim_str = wmem_strbuf_new_label(wmem_packet_scope());
for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) { for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) {
if (arr_dimension[i] != 0) { if (arr_dimension[i] != 0) {
ep_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]); wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]);
} else { } else {
break; break;
} }
@ -2190,7 +2191,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset
proto_tree_add_text(tree, tvb, offset_begin, (offset-offset_begin), proto_tree_add_text(tree, tvb, offset_begin, (offset-offset_begin),
"%s%s %s%s;%s", "%s%s %s%s;%s",
indent_string, type_name, name ? name : "", indent_string, type_name, name ? name : "",
dim_str->str, is_key ? KEY_COMMENT : ""); wmem_strbuf_get_str(dim_str), is_key ? KEY_COMMENT : "");
return retVal; return retVal;
} }
@ -2256,7 +2257,7 @@ static int rtps_util_add_bitmap(proto_tree *tree,
const char *label _U_) { const char *label _U_) {
gint32 num_bits; gint32 num_bits;
guint32 data; guint32 data;
emem_strbuf_t *temp_buff = ep_strbuf_new_label(NULL); wmem_strbuf_t *temp_buff = wmem_strbuf_new_label(wmem_packet_scope());
int i, j, idx; int i, j, idx;
gchar *last_one; gchar *last_one;
proto_item * ti; proto_item * ti;
@ -2283,27 +2284,27 @@ static int rtps_util_add_bitmap(proto_tree *tree,
offset += 4; offset += 4;
for (j = 0; j < 32; ++j) { for (j = 0; j < 32; ++j) {
datamask = (1 << (31-j)); datamask = (1 << (31-j));
ep_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0');
++idx; ++idx;
if (idx >= num_bits || temp_buff->len >= ITEM_LABEL_LENGTH - 1) { if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) {
break; break;
} }
} }
} }
/* removes all the ending '0' */ /* removes all the ending '0' */
last_one = strrchr(temp_buff->str, '1'); last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1');
if (last_one) { if (last_one) {
ep_strbuf_truncate(temp_buff, (gsize) (last_one - temp_buff->str)); wmem_strbuf_truncate(temp_buff, (gsize) (last_one - wmem_strbuf_get_str(temp_buff)));
} }
if (temp_buff->len > 0) { if (wmem_strbuf_get_len(temp_buff) > 0) {
proto_tree_add_text(bitmap_tree, proto_tree_add_text(bitmap_tree,
tvb, tvb,
original_offset + 12, original_offset + 12,
offset - original_offset - 12, offset - original_offset - 12,
"bitmap: %s", "bitmap: %s",
temp_buff->str); wmem_strbuf_get_str(temp_buff));
} }
proto_item_set_len(ti, offset-original_offset); proto_item_set_len(ti, offset-original_offset);
@ -2325,7 +2326,7 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf
guint64 base; guint64 base;
gint32 num_bits; gint32 num_bits;
guint32 data; guint32 data;
emem_strbuf_t *temp_buff = ep_strbuf_new_label(NULL); wmem_strbuf_t *temp_buff = wmem_strbuf_new_label(wmem_packet_scope());
gchar *last_one; gchar *last_one;
int i, j, idx; int i, j, idx;
proto_item * ti; proto_item * ti;
@ -2373,18 +2374,18 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf
offset += 4; offset += 4;
for (j = 0; j < 32; ++j) { for (j = 0; j < 32; ++j) {
datamask = (1 << (31-j)); datamask = (1 << (31-j));
ep_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0');
++idx; ++idx;
if (idx >= num_bits || temp_buff->len >= ITEM_LABEL_LENGTH - 1) { if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) {
break; break;
} }
} }
} }
/* removes all the ending '0' */ /* removes all the ending '0' */
last_one = strrchr(temp_buff->str, '1'); last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1');
if (last_one) { if (last_one) {
ep_strbuf_truncate(temp_buff, (gsize) (last_one - temp_buff->str)); wmem_strbuf_truncate(temp_buff, (gsize) (last_one - wmem_strbuf_get_str(temp_buff)));
} }
bitmap_tree = proto_item_add_subtree(ti, ett_rtps_bitmap); bitmap_tree = proto_item_add_subtree(ti, ett_rtps_bitmap);
@ -2398,11 +2399,11 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf
} }
proto_tree_add_uint(bitmap_tree, hf_rtps_fragment_number_num_bits, tvb, original_offset + base_size, 4, num_bits); proto_tree_add_uint(bitmap_tree, hf_rtps_fragment_number_num_bits, tvb, original_offset + base_size, 4, num_bits);
if (temp_buff->len > 0) { if (wmem_strbuf_get_len(temp_buff) > 0) {
proto_tree_add_text(bitmap_tree, tvb, proto_tree_add_text(bitmap_tree, tvb,
original_offset + base_size + 4, original_offset + base_size + 4,
offset - original_offset - base_size - 4, offset - original_offset - base_size - 4,
"bitmap: %s", temp_buff->str); "bitmap: %s", wmem_strbuf_get_str(temp_buff));
} }
proto_item_set_len(ti, offset-original_offset); proto_item_set_len(ti, offset-original_offset);
@ -5733,8 +5734,8 @@ static void dissect_RTPS_DATA_BATCH(tvbuff_t *tvb, packet_info *pinfo, gint offs
if (rtps_max_batch_samples_dissected == 0) { if (rtps_max_batch_samples_dissected == 0) {
sample_info_max = 1024; /* Max size of sampleInfo shown */ sample_info_max = 1024; /* Max size of sampleInfo shown */
} }
sample_info_flags = (guint16 *)ep_alloc(sizeof(guint16) * sample_info_max); sample_info_flags = (guint16 *)wmem_alloc(wmem_packet_scope(), sizeof(guint16) * sample_info_max);
sample_info_length = (guint32 *)ep_alloc(sizeof(guint32) * sample_info_max); sample_info_length = (guint32 *)wmem_alloc(wmem_packet_scope(), sizeof(guint32) * sample_info_max);
/* Sample Info List: start decoding the sample info list until the offset /* Sample Info List: start decoding the sample info list until the offset
* is greater or equal than 'sampleListOffset' */ * is greater or equal than 'sampleListOffset' */

View File

@ -88,7 +88,7 @@ add_sid_name_mapping(char *sid, char *name)
return; return;
} }
sn=se_new(sid_name); sn=wmem_new(wmem_file_scope(), sid_name);
sn->sid=g_strdup(sid); sn->sid=g_strdup(sid);
sn->name=g_strdup(name); sn->name=g_strdup(name);
g_hash_table_insert(sid_name_table, sn, sn); g_hash_table_insert(sid_name_table, sn, sn);
@ -148,7 +148,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co
g_hash_table_remove(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num)); g_hash_table_remove(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num));
} }
if(!old_ctx){ if(!old_ctx){
old_ctx=se_memdup(fi->value.value.bytes->data, 20); old_ctx=wmem_memdup(wmem_file_scope(), fi->value.value.bytes->data, 20);
} }
g_hash_table_insert(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num), old_ctx); g_hash_table_insert(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num), old_ctx);

View File

@ -35,7 +35,6 @@
#include <epan/packet.h> #include <epan/packet.h>
#include <epan/conversation.h> #include <epan/conversation.h>
#include <epan/tap.h> #include <epan/tap.h>
#include <epan/emem.h>
#include <epan/wmem/wmem.h> #include <epan/wmem/wmem.h>
#include <epan/aftypes.h> #include <epan/aftypes.h>
@ -673,7 +672,7 @@ static void smb2_key_derivation(const guint8 *KI _U_, guint32 KI_len _U_,
/* for export-object-smb2 */ /* for export-object-smb2 */
static gchar *policy_hnd_to_file_id(const e_ctx_hnd *hnd) { static gchar *policy_hnd_to_file_id(const e_ctx_hnd *hnd) {
gchar *file_id; gchar *file_id;
file_id = ep_strdup_printf( file_id = wmem_strdup_printf(wmem_packet_scope(),
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
hnd->uuid.Data1, hnd->uuid.Data1,
hnd->uuid.Data2, hnd->uuid.Data2,
@ -725,7 +724,7 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff
/* Create a new tvb to point to the payload data */ /* Create a new tvb to point to the payload data */
data_tvb = tvb_new_subset(tvb, dataoffset, length, length); data_tvb = tvb_new_subset(tvb, dataoffset, length, length);
/* Create the eo_info to pass to the listener */ /* Create the eo_info to pass to the listener */
eo_info = ep_new(smb_eo_t); eo_info = wmem_new(wmem_packet_scope(), smb_eo_t);
/* Fill in eo_info */ /* Fill in eo_info */
eo_info->smbversion=2; eo_info->smbversion=2;
/* cmd == opcode */ /* cmd == opcode */
@ -741,17 +740,17 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff
/* Remove "File: " from filename */ /* Remove "File: " from filename */
if (g_str_has_prefix(auxstring, "File: ")) { if (g_str_has_prefix(auxstring, "File: ")) {
aux_string_v = g_strsplit(auxstring, "File: ", -1); aux_string_v = g_strsplit(auxstring, "File: ", -1);
eo_info->filename = ep_strdup_printf("\\%s",aux_string_v[g_strv_length(aux_string_v)-1]); eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\%s",aux_string_v[g_strv_length(aux_string_v)-1]);
g_strfreev(aux_string_v); g_strfreev(aux_string_v);
} else { } else {
if (g_str_has_prefix(auxstring, "\\")) { if (g_str_has_prefix(auxstring, "\\")) {
eo_info->filename = ep_strdup(auxstring); eo_info->filename = wmem_strdup(wmem_packet_scope(), auxstring);
} else { } else {
eo_info->filename = ep_strdup_printf("\\%s",auxstring); eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\%s",auxstring);
} }
} }
} else { } else {
auxstring=ep_strdup_printf("File_Id_%s", file_id); auxstring=wmem_strdup_printf(wmem_packet_scope(), "File_Id_%s", file_id);
eo_info->filename=auxstring; eo_info->filename=auxstring;
} }
@ -767,13 +766,13 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff
if (si->tree) { if (si->tree) {
eo_info->tid=si->tree->tid; eo_info->tid=si->tree->tid;
if (strlen(si->tree->name)>0 && strlen(si->tree->name)<=256) { if (strlen(si->tree->name)>0 && strlen(si->tree->name)<=256) {
eo_info->hostname = ep_strdup(si->tree->name); eo_info->hostname = wmem_strdup(wmem_packet_scope(), si->tree->name);
} else { } else {
eo_info->hostname = ep_strdup_printf("\\\\%s\\TREEID_%i",tree_ip_str(pinfo,si->opcode),si->tree->tid); eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_%i",tree_ip_str(pinfo,si->opcode),si->tree->tid);
} }
} else { } else {
eo_info->tid=0; eo_info->tid=0;
eo_info->hostname = ep_strdup_printf("\\\\%s\\TREEID_UNKNOWN",tree_ip_str(pinfo,si->opcode)); eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_UNKNOWN",tree_ip_str(pinfo,si->opcode));
} }
/* packet number */ /* packet number */
@ -1384,9 +1383,9 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
offset = dissect_nt_guid_hnd(tvb, offset, pinfo, tree, drep, hf_smb2_fid, &policy_hnd, &hnd_item, TRUE, FALSE); offset = dissect_nt_guid_hnd(tvb, offset, pinfo, tree, drep, hf_smb2_fid, &policy_hnd, &hnd_item, TRUE, FALSE);
if (!pinfo->fd->flags.visited) { if (!pinfo->fd->flags.visited) {
if (si->saved && si->saved->extra_info_type == SMB2_EI_FILENAME) { if (si->saved && si->saved->extra_info_type == SMB2_EI_FILENAME) {
fid_name = se_strdup_printf("File: %s", (char *)si->saved->extra_info); fid_name = wmem_strdup_printf(wmem_file_scope(), "File: %s", (char *)si->saved->extra_info);
} else { } else {
fid_name = se_strdup_printf("File: "); fid_name = wmem_strdup_printf(wmem_file_scope(), "File: ");
} }
dcerpc_store_polhnd_name(&policy_hnd, pinfo, dcerpc_store_polhnd_name(&policy_hnd, pinfo,
fid_name); fid_name);
@ -1397,8 +1396,8 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
if (si->conv) { if (si->conv) {
eo_file_info = (smb2_eo_file_info_t *)g_hash_table_lookup(si->conv->files,&policy_hnd); eo_file_info = (smb2_eo_file_info_t *)g_hash_table_lookup(si->conv->files,&policy_hnd);
if (!eo_file_info) { if (!eo_file_info) {
eo_file_info = se_new(smb2_eo_file_info_t); eo_file_info = wmem_new(wmem_file_scope(), smb2_eo_file_info_t);
policy_hnd_hashtablekey = se_new(e_ctx_hnd); policy_hnd_hashtablekey = wmem_new(wmem_file_scope(), e_ctx_hnd);
memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd)); memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd));
eo_file_info->end_of_file=0; eo_file_info->end_of_file=0;
g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info); g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info);
@ -1437,8 +1436,8 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
if (eo_file_info) { if (eo_file_info) {
si->eo_file_info=eo_file_info; si->eo_file_info=eo_file_info;
} else { /* XXX This should never happen */ } else { /* XXX This should never happen */
eo_file_info = se_new(smb2_eo_file_info_t); eo_file_info = wmem_new(wmem_file_scope(), smb2_eo_file_info_t);
policy_hnd_hashtablekey = se_new(e_ctx_hnd); policy_hnd_hashtablekey = wmem_new(wmem_file_scope(), e_ctx_hnd);
memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd)); memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd));
eo_file_info->end_of_file=0; eo_file_info->end_of_file=0;
g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info); g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info);
@ -2476,11 +2475,11 @@ dissect_smb2_session_setup_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
while ((ntlmssph = (const ntlmssp_header_t *)fetch_tapped_data(ntlmssp_tap_id, idx++)) != NULL) { while ((ntlmssph = (const ntlmssp_header_t *)fetch_tapped_data(ntlmssp_tap_id, idx++)) != NULL) {
if (ntlmssph && ntlmssph->type == NTLMSSP_AUTH) { if (ntlmssph && ntlmssph->type == NTLMSSP_AUTH) {
smb2_sesid_info_t *sesid; smb2_sesid_info_t *sesid;
sesid = se_new(smb2_sesid_info_t); sesid = wmem_new(wmem_file_scope(), smb2_sesid_info_t);
sesid->sesid = si->sesid; sesid->sesid = si->sesid;
sesid->acct_name = se_strdup(ntlmssph->acct_name); sesid->acct_name = wmem_strdup(wmem_file_scope(), ntlmssph->acct_name);
sesid->domain_name = se_strdup(ntlmssph->domain_name); sesid->domain_name = wmem_strdup(wmem_file_scope(), ntlmssph->domain_name);
sesid->host_name = se_strdup(ntlmssph->host_name); sesid->host_name = wmem_strdup(wmem_file_scope(), ntlmssph->host_name);
if (memcmp(ntlmssph->session_key, zeros, NTLMSSP_KEY_LEN) != 0) { if (memcmp(ntlmssph->session_key, zeros, NTLMSSP_KEY_LEN) != 0) {
smb2_key_derivation(ntlmssph->session_key, smb2_key_derivation(ntlmssph->session_key,
NTLMSSP_KEY_LEN, NTLMSSP_KEY_LEN,
@ -2588,7 +2587,7 @@ dissect_smb2_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
*/ */
if (!pinfo->fd->flags.visited && si->saved && buf && olb.len) { if (!pinfo->fd->flags.visited && si->saved && buf && olb.len) {
si->saved->extra_info_type = SMB2_EI_TREENAME; si->saved->extra_info_type = SMB2_EI_TREENAME;
si->saved->extra_info = se_alloc(olb.len+1); si->saved->extra_info = wmem_alloc(wmem_file_scope(), olb.len+1);
g_snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf); g_snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf);
} }
@ -2623,7 +2622,7 @@ dissect_smb2_tree_connect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (tid) { if (tid) {
g_hash_table_remove(si->session->tids, &tid_key); g_hash_table_remove(si->session->tids, &tid_key);
} }
tid = se_new(smb2_tid_info_t); tid = wmem_new(wmem_file_scope(), smb2_tid_info_t);
tid->tid = si->tid; tid->tid = si->tid;
tid->name = (char *)si->saved->extra_info; tid->name = (char *)si->saved->extra_info;
tid->connect_frame = pinfo->fd->num; tid->connect_frame = pinfo->fd->num;
@ -6723,7 +6722,7 @@ dissect_smb2_tid_sesid(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb,
* a tree connect, we create a dummy sessison, so we can hang the * a tree connect, we create a dummy sessison, so we can hang the
* tree data on it * tree data on it
*/ */
si->session = se_new(smb2_sesid_info_t); si->session = wmem_new(wmem_file_scope(), smb2_sesid_info_t);
si->session->sesid = si->sesid; si->session->sesid = si->sesid;
si->session->acct_name = NULL; si->session->acct_name = NULL;
si->session->domain_name = NULL; si->session->domain_name = NULL;
@ -6795,8 +6794,8 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
smb2_eo_file_info_t *eo_file_info; smb2_eo_file_info_t *eo_file_info;
e_ctx_hnd *policy_hnd_hashtablekey; e_ctx_hnd *policy_hnd_hashtablekey;
sti = ep_new(smb2_transform_info_t); sti = wmem_new(wmem_packet_scope(), smb2_transform_info_t);
si = ep_new(smb2_info_t); si = wmem_new(wmem_packet_scope(), smb2_info_t);
si->eo_file_info = NULL; si->eo_file_info = NULL;
si->conv = NULL; si->conv = NULL;
si->saved = NULL; si->saved = NULL;
@ -6971,7 +6970,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
/* no we couldnt find it, so just add it then /* no we couldnt find it, so just add it then
* if was a request we are decoding * if was a request we are decoding
*/ */
ssi = se_new0(smb2_saved_info_t); ssi = wmem_new0(wmem_file_scope(), smb2_saved_info_t);
ssi->msg_id = ssi_key.msg_id; ssi->msg_id = ssi_key.msg_id;
ssi->frame_req = pinfo->fd->num; ssi->frame_req = pinfo->fd->num;
ssi->req_time = pinfo->fd->abs_ts; ssi->req_time = pinfo->fd->abs_ts;
@ -7006,8 +7005,8 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
eo_file_info = (smb2_eo_file_info_t *)g_hash_table_lookup(si->conv->files,&ssi->policy_hnd); eo_file_info = (smb2_eo_file_info_t *)g_hash_table_lookup(si->conv->files,&ssi->policy_hnd);
if (!eo_file_info) { /* XXX This should never happen */ if (!eo_file_info) { /* XXX This should never happen */
/* assert(1==0); */ /* assert(1==0); */
eo_file_info = se_new(smb2_eo_file_info_t); eo_file_info = wmem_new(wmem_file_scope(), smb2_eo_file_info_t);
policy_hnd_hashtablekey = se_new(e_ctx_hnd); policy_hnd_hashtablekey = wmem_new(wmem_file_scope(), e_ctx_hnd);
memcpy(policy_hnd_hashtablekey, &ssi->policy_hnd, sizeof(e_ctx_hnd)); memcpy(policy_hnd_hashtablekey, &ssi->policy_hnd, sizeof(e_ctx_hnd));
eo_file_info->end_of_file=0; eo_file_info->end_of_file=0;
g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info); g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info);

View File

@ -71,6 +71,7 @@
#include <epan/prefs.h> #include <epan/prefs.h>
#include <epan/sminmpec.h> #include <epan/sminmpec.h>
#include <epan/emem.h> #include <epan/emem.h>
#include <epan/wmem/wmem.h>
#include <epan/next_tvb.h> #include <epan/next_tvb.h>
#include <epan/uat.h> #include <epan/uat.h>
#include <epan/asn1.h> #include <epan/asn1.h>
@ -309,7 +310,7 @@ static int hf_snmp_priority = -1; /* INTEGER_M1_2147483647 */
static int hf_snmp_operation = -1; /* T_operation */ static int hf_snmp_operation = -1; /* T_operation */
/*--- End of included file: packet-snmp-hf.c ---*/ /*--- End of included file: packet-snmp-hf.c ---*/
#line 235 "../../asn1/snmp/packet-snmp-template.c" #line 236 "../../asn1/snmp/packet-snmp-template.c"
static int hf_smux_version = -1; static int hf_smux_version = -1;
static int hf_smux_pdutype = -1; static int hf_smux_pdutype = -1;
@ -352,7 +353,7 @@ static gint ett_snmp_SimpleOpen_U = -1;
static gint ett_snmp_RReqPDU_U = -1; static gint ett_snmp_RReqPDU_U = -1;
/*--- End of included file: packet-snmp-ett.c ---*/ /*--- End of included file: packet-snmp-ett.c ---*/
#line 254 "../../asn1/snmp/packet-snmp-template.c" #line 255 "../../asn1/snmp/packet-snmp-template.c"
static expert_field ei_snmp_failed_decrypted_data_pdu = EI_INIT; static expert_field ei_snmp_failed_decrypted_data_pdu = EI_INIT;
static expert_field ei_snmp_decrypted_data_bad_formatted = EI_INIT; static expert_field ei_snmp_decrypted_data_bad_formatted = EI_INIT;
@ -522,7 +523,8 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in
hour_from_utc = tvb_get_guint8(tvb,offset+9); hour_from_utc = tvb_get_guint8(tvb,offset+9);
min_from_utc = tvb_get_guint8(tvb,offset+10); min_from_utc = tvb_get_guint8(tvb,offset+10);
str = ep_strdup_printf("%u-%u-%u, %u:%u:%u.%u UTC %s%u:%u", str = wmem_strdup_printf(wmem_packet_scope(),
"%u-%u-%u, %u:%u:%u.%u UTC %s%u:%u",
year, year,
month, month,
day, day,
@ -534,7 +536,8 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in
hour_from_utc, hour_from_utc,
min_from_utc); min_from_utc);
}else{ }else{
str = ep_strdup_printf("%u-%u-%u, %u:%u:%u.%u", str = wmem_strdup_printf(wmem_packet_scope(),
"%u-%u-%u, %u:%u:%u.%u",
year, year,
month, month,
day, day,
@ -909,7 +912,7 @@ show_oid_index:
goto indexing_done; goto indexing_done;
} }
buf = (guint8*)ep_alloc(buf_len+1); buf = (guint8*)wmem_alloc(wmem_packet_scope(), buf_len+1);
for (i = 0; i < buf_len; i++) for (i = 0; i < buf_len; i++)
buf[i] = (guint8)suboid[i]; buf[i] = (guint8)suboid[i];
buf[i] = '\0'; buf[i] = '\0';
@ -1138,21 +1141,21 @@ set_label:
if (oid_info && oid_info->name) { if (oid_info && oid_info->name) {
if (oid_left >= 1) { if (oid_left >= 1) {
repr = ep_strdup_printf("%s.%s (%s)", oid_info->name, repr = wmem_strdup_printf(wmem_packet_scope(), "%s.%s (%s)", oid_info->name,
oid_subid2string(&(subids[oid_matched]),oid_left), oid_subid2string(&(subids[oid_matched]),oid_left),
oid_subid2string(subids,oid_matched+oid_left)); oid_subid2string(subids,oid_matched+oid_left));
info_oid = ep_strdup_printf("%s.%s", oid_info->name, info_oid = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", oid_info->name,
oid_subid2string(&(subids[oid_matched]),oid_left)); oid_subid2string(&(subids[oid_matched]),oid_left));
} else { } else {
repr = ep_strdup_printf("%s (%s)", oid_info->name, repr = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", oid_info->name,
oid_subid2string(subids,oid_matched)); oid_subid2string(subids,oid_matched));
info_oid = oid_info->name; info_oid = oid_info->name;
} }
} else if (oid_string) { } else if (oid_string) {
repr = ep_strdup(oid_string); repr = wmem_strdup(wmem_packet_scope(), oid_string);
info_oid = oid_string; info_oid = oid_string;
} else { } else {
repr = ep_strdup("[Bad OID]"); repr = wmem_strdup(wmem_packet_scope(), "[Bad OID]");
} }
valstr = strstr(label,": "); valstr = strstr(label,": ");
@ -2980,7 +2983,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
/*--- End of included file: packet-snmp-fn.c ---*/ /*--- End of included file: packet-snmp-fn.c ---*/
#line 1769 "../../asn1/snmp/packet-snmp-template.c" #line 1772 "../../asn1/snmp/packet-snmp-template.c"
guint guint
@ -3906,7 +3909,7 @@ void proto_register_snmp(void) {
NULL, HFILL }}, NULL, HFILL }},
/*--- End of included file: packet-snmp-hfarr.c ---*/ /*--- End of included file: packet-snmp-hfarr.c ---*/
#line 2430 "../../asn1/snmp/packet-snmp-template.c" #line 2433 "../../asn1/snmp/packet-snmp-template.c"
}; };
/* List of subtrees */ /* List of subtrees */
@ -3946,7 +3949,7 @@ void proto_register_snmp(void) {
&ett_snmp_RReqPDU_U, &ett_snmp_RReqPDU_U,
/*--- End of included file: packet-snmp-ettarr.c ---*/ /*--- End of included file: packet-snmp-ettarr.c ---*/
#line 2446 "../../asn1/snmp/packet-snmp-template.c" #line 2449 "../../asn1/snmp/packet-snmp-template.c"
}; };
static ei_register_info ei[] = { static ei_register_info ei[] = {
{ &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }}, { &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }},

View File

@ -2161,7 +2161,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo,
} }
/* convert hex string into char*/ /* convert hex string into char*/
out = (unsigned char*) ep_alloc(size > 0 ? size / 2 : 0); out = (unsigned char*) wmem_alloc(wmem_packet_scope(), size > 0 ? size / 2 : 0);
for (i = 0; i < size; i+=2) for (i = 0; i < size; i+=2)
{ {

View File

@ -295,7 +295,8 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_int(tpncp_tree, hf_tpncp_cid, tvb, 12, 4, cid); proto_tree_add_int(tpncp_tree, hf_tpncp_cid, tvb, 12, 4, cid);
offset += 16; offset += 16;
if (tpncp_events_info_db[id].tpncp_data_field_size) { if (tpncp_events_info_db[id].tpncp_data_field_size) {
tpncp_header = ep_strdup_printf("TPNCP Event: %s (%d)", val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id); tpncp_header = wmem_strdup_printf(wmem_packet_scope(), "TPNCP Event: %s (%d)",
val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id);
tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header); tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header);
dissect_tpncp_event(id, tvb, tpncp_item, &offset); dissect_tpncp_event(id, tvb, tpncp_item, &offset);
} }
@ -306,7 +307,8 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree_add_uint(tpncp_tree, hf_tpncp_command_id, tvb, 8, 4, id); proto_tree_add_uint(tpncp_tree, hf_tpncp_command_id, tvb, 8, 4, id);
offset += 12; offset += 12;
if (tpncp_commands_info_db[id].tpncp_data_field_size) { if (tpncp_commands_info_db[id].tpncp_data_field_size) {
tpncp_header = ep_strdup_printf("TPNCP Command: %s (%d)", val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id); tpncp_header = wmem_strdup_printf(wmem_packet_scope(), "TPNCP Command: %s (%d)",
val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id);
tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header); tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header);
dissect_tpncp_command(id, tvb, tpncp_item, &offset); dissect_tpncp_command(id, tvb, tpncp_item, &offset);
} }

View File

@ -30,7 +30,7 @@
#include <glib.h> #include <glib.h>
#include "epan/packet.h" #include "epan/packet.h"
#include "epan/emem.h" #include "epan/wmem/wmem.h"
#include "packet-uaudp.h" #include "packet-uaudp.h"
@ -1643,7 +1643,7 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
const gchar* command_str; const gchar* command_str;
proto_tree *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_option_tree; proto_tree *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_option_tree;
proto_item *ua3g_param_item, *ua3g_option_item; proto_item *ua3g_param_item, *ua3g_option_item;
emem_strbuf_t *strbuf; wmem_strbuf_t *strbuf;
command = tvb_get_guint8(tvb, offset) & 0x03; command = tvb_get_guint8(tvb, offset) & 0x03;
column_n = tvb_get_guint8(tvb, offset + 1); column_n = tvb_get_guint8(tvb, offset + 1);
@ -1655,13 +1655,13 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
if (!ua3g_body_tree) if (!ua3g_body_tree)
return; return;
strbuf = ep_strbuf_new_label("\""); strbuf = wmem_strbuf_new_label(wmem_packet_scope());
ep_strbuf_append_printf(strbuf, "%s\"", tvb_format_text(tvb, offset + 2, length - 2)); wmem_strbuf_append_printf(strbuf, "\"%s\"", tvb_format_text(tvb, offset + 2, length - 2));
ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset,
length, "%s %d: %s", length, "%s %d: %s",
command_str, column_n, strbuf->str); command_str, column_n, wmem_strbuf_get_str(strbuf));
ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);
proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_lcd_line, tvb, offset, 1, ENC_NA); proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_lcd_line, tvb, offset, 1, ENC_NA);
@ -1685,7 +1685,7 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
offset++; offset++;
length--; length--;
proto_tree_add_text(ua3g_param_tree, tvb, offset, length, "ASCII Char: %s", strbuf->str); proto_tree_add_text(ua3g_param_tree, tvb, offset, length, "ASCII Char: %s", wmem_strbuf_get_str(strbuf));
} }
@ -2134,20 +2134,20 @@ decode_beep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
case 0x04: /* Start Beep */ case 0x04: /* Start Beep */
{ {
guint8 beep_dest; guint8 beep_dest;
emem_strbuf_t *strbuf; wmem_strbuf_t *strbuf;
int i; int i;
beep_dest = tvb_get_guint8(tvb, offset); beep_dest = tvb_get_guint8(tvb, offset);
strbuf = ep_strbuf_new_label(NULL); strbuf = wmem_strbuf_new_label(wmem_packet_scope());
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
ep_strbuf_append(strbuf, wmem_strbuf_append(strbuf,
val_to_str_const(beep_dest & (0x01 << i), str_start_beep_destination, "")); val_to_str_const(beep_dest & (0x01 << i), str_start_beep_destination, ""));
} }
proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, proto_tree_add_text(ua3g_body_tree, tvb, offset, 1,
"Destination: %s", strbuf->str); "Destination: %s", wmem_strbuf_get_str(strbuf));
offset++; offset++;
proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_NA); proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_NA);
@ -2488,33 +2488,33 @@ decode_audio_config(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
" Bluetooth Link", " Bluetooth Link",
" USB Link" " USB Link"
}; };
emem_strbuf_t *strbuf; wmem_strbuf_t *strbuf;
guint8 device_values; guint8 device_values;
int j; int j;
int device_index = 0; int device_index = 0;
strbuf = ep_strbuf_new_label(NULL); strbuf = wmem_strbuf_new_label(wmem_packet_scope());
while (length > 0) { while (length > 0) {
device_values = tvb_get_guint8(tvb, offset); device_values = tvb_get_guint8(tvb, offset);
ep_strbuf_truncate(strbuf, 0); wmem_strbuf_truncate(strbuf, 0);
if (device_values != 0) { if (device_values != 0) {
for (j = 0; j < 5; j++) { for (j = 0; j < 5; j++) {
if (device_values & (0x01 << j)) { if (device_values & (0x01 << j)) {
ep_strbuf_append(strbuf, str_device_values[j]); wmem_strbuf_append(strbuf, str_device_values[j]);
} }
} }
} else { } else {
ep_strbuf_append(strbuf, " None"); wmem_strbuf_append(strbuf, " None");
} }
proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, proto_tree_add_text(ua3g_body_tree, tvb, offset, 1,
"%s:%s", "%s:%s",
val_to_str_const(device_index, str_device_configuration, "Unknown"), val_to_str_const(device_index, str_device_configuration, "Unknown"),
strbuf->str); wmem_strbuf_get_str(strbuf));
offset++; offset++;
length--; length--;
device_index++; device_index++;
@ -3180,7 +3180,7 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb,
proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, parameter_length, ENC_BIG_ENDIAN); proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
} else { } else {
proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, 8, ENC_BIG_ENDIAN); proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, 8, ENC_BIG_ENDIAN);
/* XXX - add as expert info ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ /* XXX - add as expert info wmem_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */
} }
break; break;
case 0x10: /* VAD */ case 0x10: /* VAD */
@ -3194,7 +3194,7 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb,
proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, parameter_length, ENC_BIG_ENDIAN); proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
} else { } else {
proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, 8, ENC_BIG_ENDIAN); proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, 8, ENC_BIG_ENDIAN);
/* XXX - add as expert info ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ /* XXX - add as expert info wmem_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */
} }
break; break;
case 0x1B: /* Delay Distribution */ case 0x1B: /* Delay Distribution */

View File

@ -29,7 +29,7 @@
#include "config.h" #include "config.h"
#include "packet-rpc.h" #include "packet-rpc.h"
#include <epan/emem.h> #include <epan/wmem/wmem.h>
/* /*
* For the protocol specifications, see * For the protocol specifications, see
@ -243,23 +243,23 @@ dissect_flags(tvbuff_t *tvb, int offset, proto_tree *tree)
if (flags != 0) if (flags != 0)
{ {
emem_strbuf_t *strbuf = ep_strbuf_new_label(NULL); wmem_strbuf_t *strbuf = wmem_strbuf_new_label(wmem_packet_scope());
if (flags & VXI11_CORE_FLAG_WAITLOCK) if (flags & VXI11_CORE_FLAG_WAITLOCK)
{ {
ep_strbuf_append(strbuf, "WAIT_LOCK, "); wmem_strbuf_append(strbuf, "WAIT_LOCK, ");
} }
if (flags & VXI11_CORE_FLAG_END) if (flags & VXI11_CORE_FLAG_END)
{ {
ep_strbuf_append(strbuf, "END, "); wmem_strbuf_append(strbuf, "END, ");
} }
if (flags & VXI11_CORE_FLAG_TERMCHRSET) if (flags & VXI11_CORE_FLAG_TERMCHRSET)
{ {
ep_strbuf_append(strbuf, "TERM_CHR_SET, "); wmem_strbuf_append(strbuf, "TERM_CHR_SET, ");
} }
ep_strbuf_truncate(strbuf, strbuf->len - 2); wmem_strbuf_truncate(strbuf, wmem_strbuf_get_len(strbuf) - 2);
proto_item_append_text(flags_item, " (%s)", strbuf->str); proto_item_append_text(flags_item, " (%s)", wmem_strbuf_get_str(strbuf));
} }
} }
} }
@ -288,23 +288,23 @@ dissect_reason(tvbuff_t *tvb, int offset, proto_tree *tree)
if (reason != 0) if (reason != 0)
{ {
emem_strbuf_t *strbuf = ep_strbuf_new_label(NULL); wmem_strbuf_t *strbuf = wmem_strbuf_new_label(wmem_packet_scope());
if (reason & VXI11_CORE_REASON_REQCNT) if (reason & VXI11_CORE_REASON_REQCNT)
{ {
ep_strbuf_append(strbuf, "REQ_CNT, "); wmem_strbuf_append(strbuf, "REQ_CNT, ");
} }
if (reason & VXI11_CORE_REASON_CHR) if (reason & VXI11_CORE_REASON_CHR)
{ {
ep_strbuf_append(strbuf, "CHR, "); wmem_strbuf_append(strbuf, "CHR, ");
} }
if (reason & VXI11_CORE_REASON_END) if (reason & VXI11_CORE_REASON_END)
{ {
ep_strbuf_append(strbuf, "END, "); wmem_strbuf_append(strbuf, "END, ");
} }
ep_strbuf_truncate(strbuf, strbuf->len - 2); wmem_strbuf_truncate(strbuf, wmem_strbuf_get_len(strbuf) - 2);
proto_item_append_text(reason_item, " (%s)", strbuf->str); proto_item_append_text(reason_item, " (%s)", wmem_strbuf_get_str(strbuf));
} }
} }
} }

View File

@ -32,7 +32,7 @@
#include <epan/packet.h> #include <epan/packet.h>
#include <epan/prefs.h> /* req'd for packet-zbee-security.h */ #include <epan/prefs.h> /* req'd for packet-zbee-security.h */
#include <epan/expert.h> #include <epan/expert.h>
#include <epan/emem.h> #include <epan/wmem/wmem.h>
#include <epan/reassemble.h> #include <epan/reassemble.h>
#include "packet-zbee.h" #include "packet-zbee.h"
@ -1235,7 +1235,8 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
key_record.frame_num = pinfo->fd->num; key_record.frame_num = pinfo->fd->num;
key_record.label = NULL; key_record.label = NULL;
memcpy(&key_record.key, &key, ZBEE_APS_CMD_KEY_LENGTH); memcpy(&key_record.key, &key, ZBEE_APS_CMD_KEY_LENGTH);
*nwk_keyring = g_slist_prepend(*nwk_keyring, se_memdup(&key_record, sizeof(key_record_t))); *nwk_keyring = g_slist_prepend(*nwk_keyring, wmem_memdup(wmem_file_scope(),
&key_record, sizeof(key_record_t)));
} }
} }
} }