diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2007-08-15 22:27:52 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2007-08-15 22:27:52 +0000 |
commit | 3dec62b85cf62734219cc0278c41582d5aa5bc2b (patch) | |
tree | 281bd56379c0017cc168bdd0ffe45a0d88efc5e4 /epan/dissectors/packet-imf.c | |
parent | 0cab42b4659e2f1e35d22da6b5a849913b357f1b (diff) | |
download | wireshark-3dec62b85cf62734219cc0278c41582d5aa5bc2b.tar.gz |
- s/ntohs/g_ntohs
- s/ntohl/g_ntohl
- s/free/g_free
- Change some tvb_get_string()+g_free()'s into tvb_get_ephemeral_string()
- Change some tvb_fake_unicode()+g_free()'s into tvb_get_ephemeral_faked_unicode()
- Change some tvb_get_string() calls that were clearly memory leaks (like
atoi(tvb_get_string(...))) into tvb_get_ephemeral_string()
svn path=/trunk/; revision=22515
Diffstat (limited to 'epan/dissectors/packet-imf.c')
-rw-r--r-- | epan/dissectors/packet-imf.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 1c5e6aa8a9..7c2cb96b8d 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -405,14 +405,14 @@ static void dissect_imf_content_type(tvbuff_t *tvb, int offset, int length, prot len = first_colon - offset; proto_tree_add_item(ct_tree, hf_imf_content_type_type, tvb, offset, len, FALSE); if(type) - /* this string must be freed */ - (*type) = tvb_get_string(tvb, offset, len); + /* This string will be automatically freed */ + (*type) = tvb_get_ephemeral_string(tvb, offset, len); len = length - (first_colon + 1 - offset); proto_tree_add_item(ct_tree, hf_imf_content_type_parameters, tvb, first_colon + 1, len, FALSE); if(parameters) - /* this string must be freed */ - (*parameters) = tvb_get_string(tvb, first_colon + 1, len); + /* This string will be automatically freed */ + (*parameters) = tvb_get_ephemeral_string(tvb, first_colon + 1, len); } } @@ -596,13 +596,6 @@ static void dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dissected = dissector_try_string(media_type_dissector_table, content_type_str, next_tvb, pinfo, tree); - g_free(content_type_str); - content_type_str = NULL; - - if(parameters) { - g_free(parameters); - parameters = NULL; - } } else { /* just show the lines or highlight the rest of the buffer as message text */ |