Replace the last of ep_alloc and ep_alloc0 with wmem equivalent.

Change-Id: I0338d0acda5e4b9957aad4825ca2cfd6fa506ead
Reviewed-on: https://code.wireshark.org/review/6596
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2015-01-17 16:55:46 -05:00
parent b5eb9710db
commit 0ad15f88cc
4 changed files with 12 additions and 14 deletions

View File

@ -79,11 +79,11 @@ print_nsap_net_buf( const guint8 *ad, int length, gchar *buf, int buf_len)
} /* print_nsap */
gchar *
print_system_id( const guint8 *ad, int length )
print_system_id(wmem_allocator_t* scope, const guint8 *ad, int length )
{
gchar *cur;
cur = (gchar *)ep_alloc(MAX_SYSTEMID_LEN * 3 + 5);
cur = (gchar *)wmem_alloc(scope, MAX_SYSTEMID_LEN * 3 + 5);
print_system_id_buf(ad, length, cur, MAX_SYSTEMID_LEN * 3 + 5);
return( cur );
}
@ -91,7 +91,7 @@ print_system_id( const guint8 *ad, int length )
gchar *
tvb_print_system_id( tvbuff_t *tvb, const gint offset, int length )
{
return( print_system_id(tvb_get_ptr(tvb, offset, length), length) );
return( print_system_id(wmem_packet_scope(), tvb_get_ptr(tvb, offset, length), length) );
}
void

View File

@ -49,7 +49,7 @@ gchar* print_nsap_net ( const guint8 *, int );
void print_nsap_net_buf( const guint8 *, int, gchar *, int);
gchar* print_area ( const guint8 *, int );
void print_area_buf ( const guint8 *, int, gchar *, int);
gchar* print_system_id( const guint8 *, int );
gchar* print_system_id(wmem_allocator_t *, const guint8 *, int );
gchar* tvb_print_system_id( tvbuff_t *, const gint, int );
void print_system_id_buf( const guint8 *, int, gchar *, int);

View File

@ -4412,11 +4412,9 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
break;
case FT_GUID:
{
str = guid_to_str(NULL, (e_guid_t *)fvalue_get(&finfo->value));
offset_r += protoo_strlcpy(result+offset_r, str, size-offset_r);
wmem_free(NULL, str);
}
break;
case FT_REL_OID:
@ -4443,12 +4441,10 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence,
case FT_SYSTEM_ID:
bytes = (guint8 *)fvalue_get(&finfo->value);
offset_r += protoo_strlcpy(result+offset_r,
print_system_id(bytes, fvalue_length(&finfo->value)),
size-offset_r);
offset_e += protoo_strlcpy(expr+offset_e,
print_system_id(bytes, fvalue_length(&finfo->value)),
size-offset_e);
str = print_system_id(NULL, bytes, fvalue_length(&finfo->value));
offset_r += protoo_strlcpy(result+offset_r, str, size-offset_r);
offset_e += protoo_strlcpy(expr+offset_e, str, size-offset_e);
wmem_free(NULL, str);
break;
case FT_FLOAT:
@ -6236,7 +6232,9 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_SYSTEM_ID:
bytes = (guint8 *)fvalue_get(&fi->value);
label_fill(label_str, 0, hfinfo, print_system_id(bytes, fvalue_length(&fi->value)));
tmp = print_system_id(NULL, bytes, fvalue_length(&fi->value));
label_fill(label_str, 0, hfinfo, tmp);
wmem_free(NULL, tmp);
break;
case FT_EUI64:

View File

@ -891,7 +891,7 @@ decode_bits_in_field(const guint bit_offset, const gint no_of_bits, const guint6
mask = mask << (no_of_bits-1);
/* Prepare the string, 256 pos for the bits and zero termination, + 64 for the spaces */
str=(char *)ep_alloc0(256+64);
str=(char *)wmem_alloc0(wmem_packet_scope(), 256+64);
for(bit=0;bit<((int)(bit_offset&0x07));bit++){
if(bit&&(!(bit%4))){
str[str_p] = ' ';