aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-21 20:24:17 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2007-08-21 20:24:17 +0000
commitba23837d62a4059a826747aff18e5722201c1168 (patch)
tree49e3ab9062d3ddbce19a83f7b4baf220ffaaff32 /epan
parent9299be94a6b67da52e4a66da7ffb4a946097a459 (diff)
When saving off a temporary copy of an address, use SET_ADDRESS instead of COPY_ADDRESS so as to avoid a memory leak (or adding g_free() calls to fix said memory leak).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22568 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-smpp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c
index 16d46a6566..de5544dfed 100644
--- a/epan/dissectors/packet-smpp.c
+++ b/epan/dissectors/packet-smpp.c
@@ -1403,8 +1403,8 @@ submit_sm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
{
DebugLog(("UDHI present - set addresses\n"));
/* Save original addresses */
- COPY_ADDRESS(&save_src, &(pinfo->src));
- COPY_ADDRESS(&save_dst, &(pinfo->dst));
+ SET_ADDRESS(&save_src, pinfo->src.type, pinfo->src.len, pinfo->src.data);
+ SET_ADDRESS(&save_dst, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
/* Set SMPP source and destination address */
SET_ADDRESS(&(pinfo->src), AT_STRINGZ, 1+strlen(src_str), src_str);
SET_ADDRESS(&(pinfo->dst), AT_STRINGZ, 1+strlen(dst_str), dst_str);
@@ -1412,8 +1412,8 @@ submit_sm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
MIN(length, tvb_reported_length(tvb) - offset), length);
call_dissector (gsm_sms_handle, tvb_msg, pinfo, top_tree);
/* Restore original addresses */
- COPY_ADDRESS(&(pinfo->src), &save_src);
- COPY_ADDRESS(&(pinfo->dst), &save_dst);
+ SET_ADDRESS(&(pinfo->src), save_src.type, save_src.len, save_src.data );
+ SET_ADDRESS(&(pinfo->dst), save_dst.type, save_dst.len, save_dst.data);
}
offset += length;
}