offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
hf_pn_io_station_name_length, &u16NameLength);
- pu8StationName = g_malloc(u16NameLength+1);
+ pu8StationName = ep_alloc(u16NameLength+1);
tvb_memcpy(tvb, pu8StationName, offset, u16NameLength);
pu8StationName[u16NameLength] = '\0';
proto_tree_add_string (tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pu8StationName);
- g_free(pu8StationName);
offset += u16NameLength;
/*if (check_col(pinfo->cinfo, COL_INFO))
offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
hf_pn_io_station_name_length, &u16NameLength);
- pu8StationName = g_malloc(u16NameLength+1);
+ pu8StationName = ep_alloc(u16NameLength+1);
tvb_memcpy(tvb, pu8StationName, offset, u16NameLength);
pu8StationName[u16NameLength] = '\0';
proto_tree_add_string (tree, hf_pn_io_provider_station_name, tvb, offset, u16NameLength, pu8StationName);
- g_free(pu8StationName);
offset += u16NameLength;
return offset;
switch(suboption) {
case(PNDCP_SUBOPTION_DEVICE_MANUF):
- typeofstation = g_malloc(block_length+1);
+ typeofstation = ep_alloc(block_length+1);
tvb_memcpy(tvb, typeofstation, offset, block_length);
typeofstation[block_length] = '\0';
proto_tree_add_string (tree, hf_pn_dcp_suboption_device_typeofstation, tvb, offset, block_length, typeofstation);
if(is_response)
proto_item_append_text(block_item, ", Status: %u", status);
proto_item_append_text(block_item, ", TypeOfStation: \"%s\"", typeofstation);
- g_free(typeofstation);
offset += block_length;
break;
case(PNDCP_SUBOPTION_DEVICE_NAMEOFSTATION):
- nameofstation = g_malloc(block_length+1);
+ nameofstation = ep_alloc(block_length+1);
tvb_memcpy(tvb, nameofstation, offset, block_length);
nameofstation[block_length] = '\0';
proto_tree_add_string (tree, hf_pn_dcp_suboption_device_nameofstation, tvb, offset, block_length, nameofstation);
if(is_response)
proto_item_append_text(block_item, ", Status: %u", status);
proto_item_append_text(block_item, ", \"%s\"", nameofstation);
- g_free(nameofstation);
offset += block_length;
break;
case(PNDCP_SUBOPTION_DEVICE_DEV_ID):
proto_item_append_text(block_item, ", PN-Supervisor");
break;
case(PNDCP_SUBOPTION_DEVICE_DEV_OPTIONS):
- info_str = g_strdup_printf(", Dev-Options(%u)", block_length/2);
+ info_str = ep_strdup_printf(", Dev-Options(%u)", block_length/2);
pn_append_info(pinfo, dcp_item, info_str);
- g_free(info_str);
proto_item_append_text(block_item, "Device/Device Options");
if(is_response)
proto_item_append_text(block_item, ", Status: %u", status);
offset = dissect_PNDCP_Option(tvb, offset, pinfo, tree, block_item, hf_pn_dcp_suboption_control_status,
FALSE /* append_col */);
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_result, &result);
- info_str = g_strdup_printf(", Response(%s)", val_to_str(result, pn_dcp_result, "Unknown"));
+ info_str = ep_strdup_printf(", Response(%s)", val_to_str(result, pn_dcp_result, "Unknown"));
pn_append_info(pinfo, dcp_item, info_str);
- g_free(info_str);
proto_item_append_text(block_item, ", Result: %s", val_to_str(result, pn_dcp_result, "Unknown"));
break;
default:
return;
}
- xid_str = g_strdup_printf(", Xid:0x%x", xid);
+ xid_str = ep_strdup_printf(", Xid:0x%x", xid);
pn_append_info(pinfo, dcp_item, xid_str);
- g_free(xid_str);
/* dissect a number of blocks (depending on the remaining length) */
while(data_length) {