aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-01-29 18:51:00 -0500
committerMichael Mann <mmann78@netscape.net>2017-01-30 02:25:45 +0000
commitf789c91a5ebbbefba51aa3da983fe836ebc860d6 (patch)
treece4a066bc1d1e8fe4a3bfc1f49e171d8aeda33d2 /epan/proto.c
parent9365fd3d3a4cdac07d70bd77f7a42f3260b33b5e (diff)
Have format_text_wsp use wmem allocated memory.
format_text_wsp is fed into by tvb_format_text_wsp and tvb_format_stringzpad_wsp so those functions need to add a wmem allocated parameter as well. Most of the changes came from tvb_format_text_wsp and tvb_format_stringzpad_wsp being changed more so than format_text_wsp. Change-Id: I52214ca107016f0e96371a9a8430aa89336f91d7 Reviewed-on: https://code.wireshark.org/review/19851 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c
index d42ac90a7a..42c0227ba0 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1338,6 +1338,7 @@ proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint
{
proto_item *pi;
header_field_info *hfinfo;
+ gchar* str;
CHECK_FOR_NULL_TREE(tree);
@@ -1347,7 +1348,9 @@ proto_tree_add_format_wsp_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint
TRY_TO_FAKE_THIS_REPR(pi);
- proto_item_set_text(pi, "%s", tvb_format_text_wsp(tvb, start, length));
+ str = tvb_format_text_wsp(NULL, tvb, start, length);
+ proto_item_set_text(pi, "%s", str);
+ wmem_free(NULL, str);
return pi;
}