diff options
author | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-08-17 21:21:50 +0000 |
---|---|---|
committer | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-08-17 21:21:50 +0000 |
commit | f97590c6f66f979e491dd57109961dd34d08c315 (patch) | |
tree | 06d50649be09639d3197dcd155bd0b906b3a6a3c /epan/dissectors/packet-dcp-etsi.c | |
parent | e2ee72cfc2fa583b176c9156de9f365fa07eb479 (diff) |
Replace a couple more calls to tvb_get_string() with tvb_get_ephemeral_string(). 2 of the 3 replacements fix memory leaks.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22542 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dcp-etsi.c')
-rw-r--r-- | epan/dissectors/packet-dcp-etsi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c index db396fdb14..34d3433c92 100644 --- a/epan/dissectors/packet-dcp-etsi.c +++ b/epan/dissectors/packet-dcp-etsi.c @@ -149,7 +149,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) { guint8 *sync; proto_tree *dcp_tree = NULL; - sync = tvb_get_string (tvb, 0, 2); + sync = tvb_get_ephemeral_string (tvb, 0, 2); if((sync[0]!='A' && sync[0]!='P') || sync[1]!='F') return FALSE; @@ -171,7 +171,6 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) } dissector_try_string(dcp_dissector_table, (char*)sync, tvb, pinfo, dcp_tree); - g_free (sync); return TRUE; } @@ -612,7 +611,7 @@ dissect_tpl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) while(offset<tvb_length(tvb)) { guint32 bits; guint32 bytes; - char *tag = (char*)tvb_get_string (tvb, offset, 4); offset += 4; + char *tag = (char*)tvb_get_ephemeral_string (tvb, offset, 4); offset += 4; bits = tvb_get_ntohl(tvb, offset); offset += 4; bytes = bits / 8; if(bits % 8) @@ -621,7 +620,7 @@ dissect_tpl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_item *i = NULL; const guint8 *p = tvb_get_ptr(tvb, offset, bytes); if(strcmp(tag, "*ptr")==0) { - prot = (char*)tvb_get_string (tvb, offset, 4); + prot = (char*)tvb_get_ephemeral_string (tvb, offset, 4); maj = tvb_get_ntohs(tvb, offset+4); min = tvb_get_ntohs(tvb, offset+6); i = proto_tree_add_bytes_format(tpl_tree, hf_tpl_tlv, tvb, |