diff options
-rw-r--r-- | epan/exported_pdu.c | 4 | ||||
-rw-r--r-- | ui/tap_export_pdu.c | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/epan/exported_pdu.c b/epan/exported_pdu.c index d260415328..c8be3a16e8 100644 --- a/epan/exported_pdu.c +++ b/epan/exported_pdu.c @@ -248,7 +248,7 @@ export_pdu_create_tags(packet_info *pinfo, const char* proto_name, guint16 tag_t DISSECTOR_ASSERT(proto_name != NULL); DISSECTOR_ASSERT((tag_type == EXP_PDU_TAG_PROTO_NAME) || (tag_type == EXP_PDU_TAG_HEUR_PROTO_NAME) || (tag_type == EXP_PDU_TAG_DISSECTOR_TABLE_NAME)); - exp_pdu_data = (exp_pdu_data_t *)g_malloc(sizeof(exp_pdu_data_t)); + exp_pdu_data = (exp_pdu_data_t *)wmem_alloc(wmem_packet_scope(), sizeof(exp_pdu_data_t)); /* Start by computing size of protocol name as a tag */ proto_str_len = (int)strlen(proto_name); @@ -268,7 +268,7 @@ export_pdu_create_tags(packet_info *pinfo, const char* proto_name, guint16 tag_t /* Add end of options length */ tag_buf_size+=4; - exp_pdu_data->tlv_buffer = (guint8 *)g_malloc0(tag_buf_size); + exp_pdu_data->tlv_buffer = (guint8 *)wmem_alloc0(wmem_packet_scope(), tag_buf_size); exp_pdu_data->tlv_buffer_len = tag_buf_size; buffer_data = exp_pdu_data->tlv_buffer; diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c index 6865b0c839..05e017f5a0 100644 --- a/ui/tap_export_pdu.c +++ b/ui/tap_export_pdu.c @@ -41,7 +41,6 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const if(exp_pdu_data->tlv_buffer_len > 0){ memcpy(packet_buf, exp_pdu_data->tlv_buffer, exp_pdu_data->tlv_buffer_len); - g_free(exp_pdu_data->tlv_buffer); } if(exp_pdu_data->tvb_captured_length > 0){ tvb_memcpy(exp_pdu_data->pdu_tvb, packet_buf+exp_pdu_data->tlv_buffer_len, 0, exp_pdu_data->tvb_captured_length); |