aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cip.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2021-08-27 14:56:00 -0400
committerAndersBroman <a.broman58@gmail.com>2021-09-01 03:54:52 +0000
commitcdfab0d6e991df2fd3591ef896ba36937a8d4dfc (patch)
tree180c49932c562eb644c5f24d6c8d8cbf13a936e3 /epan/dissectors/packet-cip.c
parent61e66c37abb1b7f59726e4407ac8dd53e6b75cac (diff)
tvbuff: convert helper methods to pinfo->pool
A few of them just needed scratch memory, so allocate and free it manually after doing any exception-raising checks. A few others were returning memory, and needed conversion to accept a wmem scope argument.
Diffstat (limited to 'epan/dissectors/packet-cip.c')
-rw-r--r--epan/dissectors/packet-cip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index 3e07af394f..08651f7d18 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -4289,7 +4289,7 @@ static int dissect_segment_symbolic(tvbuff_t *tvb, proto_tree *path_seg_tree,
if (symbol_size != 0)
{
gchar *symbol_name;
- symbol_name = tvb_format_text(tvb, offset + 1, symbol_size);
+ symbol_name = tvb_format_text(wmem_packet_scope(), tvb, offset + 1, symbol_size);
proto_item_append_text(path_seg_item, " (Symbolic Segment)");
@@ -4506,7 +4506,7 @@ static int dissect_segment_port(tvbuff_t* tvb, int offset, gboolean generate,
proto_item* it = proto_tree_add_uint(path_seg_item, hf_cip_link_address_size, tvb, 0, 0, opt_link_size);
proto_item_set_generated(it);
/* Add extended link address */
- it = proto_tree_add_string(path_seg_item, hf_cip_link_address_string, tvb, 0, 0, tvb_format_text(tvb, offset + offset_link_address, opt_link_size));
+ it = proto_tree_add_string(path_seg_item, hf_cip_link_address_string, tvb, 0, 0, tvb_format_text(wmem_packet_scope(), tvb, offset + offset_link_address, opt_link_size));
proto_item_set_generated(it);
}
else
@@ -4515,7 +4515,7 @@ static int dissect_segment_port(tvbuff_t* tvb, int offset, gboolean generate,
proto_tree_add_item(path_seg_item, hf_cip_link_address_string, tvb, offset + offset_link_address, opt_link_size, ENC_ASCII | ENC_NA);
}
- proto_item_append_text(epath_item, ", Address: %s", tvb_format_text(tvb, offset + offset_link_address, opt_link_size));
+ proto_item_append_text(epath_item, ", Address: %s", tvb_format_text(wmem_packet_scope(), tvb, offset + offset_link_address, opt_link_size));
/* Pad byte */
if (opt_link_size % 2)
@@ -4764,7 +4764,7 @@ static int dissect_segment_ansi_extended_symbol(packet_info* pinfo, tvbuff_t* tv
/* Segment data */
if (seg_size != 0)
{
- gchar* symbol_name = tvb_format_text(tvb, offset + 2, seg_size);
+ gchar* symbol_name = tvb_format_text(pinfo->pool, tvb, offset + 2, seg_size);
if (generate)
{