From c44c8f9e6c7b633eae3129c58aab991ddc8678ed Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 29 Jan 2017 14:19:25 -0500 Subject: Have format_text_chr use wmem allocated memory. Change-Id: Idcea59f6fc84238f04d9ffc11a0088ef97beec0c Reviewed-on: https://code.wireshark.org/review/19844 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-mq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-mq.c') diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index 06ac0a3bf3..b4a841bc48 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -2844,12 +2844,12 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } iApp = tvb_get_guint32(tvb, offset + 48 + 28, iCod); - sApplicationName = format_text_chr(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 28, iEnc), 28, '.'); + sApplicationName = format_text_chr(wmem_packet_scope(), tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 28, iEnc), 28, '.'); if (strip_trailing_blanks((guint8 *)sApplicationName, 28) > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " App=%s", sApplicationName); } - sQMgr = format_text_chr(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 48, iEnc), 48, '.'); + sQMgr = format_text_chr(wmem_packet_scope(), tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 48, iEnc), 48, '.'); if (strip_trailing_blanks((guint8 *)sQMgr, 48) > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQMgr); @@ -3740,7 +3740,7 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (*sStr) strip_trailing_blanks(sStr, iLenStr); if (*sStr) - format_text_chr(sStr, strlen((const char *)sStr), '.'); + sStr = (guint8*)format_text_chr(wmem_packet_scope(), sStr, strlen((const char *)sStr), '.'); rfh_tree = proto_tree_add_subtree_format(mq_tree, tvb, iPos, iLenStr+4, ett_mq_rfh_ValueName, NULL, "NameValue: %s", sStr); -- cgit v1.2.3