aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Kaplan <me@moshekaplan.com>2021-06-13 21:58:51 -0400
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-06-14 05:22:45 +0000
commit5e2a8f37f0329af9034a0822ad8c643ce8f9c5a3 (patch)
treef36d2440b7a61d5dd3a0d3efe7bff13af9ecfda3
parent9f1835688876918c0be2501e31bacb899d934ede (diff)
downloadwireshark-5e2a8f37f0329af9034a0822ad8c643ce8f9c5a3.tar.gz
wireshark-5e2a8f37f0329af9034a0822ad8c643ce8f9c5a3.tar.bz2
wireshark-5e2a8f37f0329af9034a0822ad8c643ce8f9c5a3.zip
Avoid duplicating duplicated memory
No reason to call wmem_strdup() on newly-allocated memory that is exclusively used for that call and they both have wmem_packet_scope().
-rw-r--r--epan/dissectors/packet-iax2.c4
-rw-r--r--epan/dissectors/packet-ipp.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 5b3d34b2fb..f45ec6e966 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -1305,10 +1305,10 @@ static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
break;
case IAX_IE_CALLED_NUMBER:
- iax2_info->calledParty = wmem_strdup(wmem_packet_scope(), tvb_format_text(tvb, offset+2, ies_len));
+ iax2_info->calledParty = tvb_format_text(tvb, offset+2, ies_len);
break;
case IAX_IE_CALLING_NUMBER:
- iax2_info->callingParty = wmem_strdup(wmem_packet_scope(), tvb_format_text(tvb, offset+2, ies_len));
+ iax2_info->callingParty = tvb_format_text(tvb, offset+2, ies_len);
break;
case IAX_IE_APPARENT_ADDR:
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c
index 4fb50bea9b..32ff564232 100644
--- a/epan/dissectors/packet-ipp.c
+++ b/epan/dissectors/packet-ipp.c
@@ -1250,7 +1250,7 @@ add_octetstring_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int name_lengt
break;
default :
- value = wmem_strdup(wmem_packet_scope(), tvb_bytes_to_str(wmem_packet_scope(), tvb, offset + 1 + 2 + name_length + 2, value_length));
+ value = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset + 1 + 2 + name_length + 2, value_length);
valoffset += 1 + 2 + name_length + 2 + value_length;
break;