aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcp-etsi.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2007-08-17 21:21:50 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2007-08-17 21:21:50 +0000
commitd47443ba387615fa463f636ca22de072ca595fb1 (patch)
tree06d50649be09639d3197dcd155bd0b906b3a6a3c /epan/dissectors/packet-dcp-etsi.c
parenta692269fc9f5b8da50448fb7a5c5d7fab21e458c (diff)
Replace a couple more calls to tvb_get_string() with tvb_get_ephemeral_string(). 2 of the 3 replacements fix memory leaks.
svn path=/trunk/; revision=22542
Diffstat (limited to 'epan/dissectors/packet-dcp-etsi.c')
-rw-r--r--epan/dissectors/packet-dcp-etsi.c7
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,