summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-07-28 09:56:19 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-07-28 09:56:19 +0000
commitdf2d1d3f22347fcbcb37783355fcd1589f99b019 (patch)
treef7011285be6f20666875d3618d1f296306ff9531 /epan
parent0d7a2abbc76409c342cc283ece9f2947aec643b7 (diff)
downloadwireshark-df2d1d3f22347fcbcb37783355fcd1589f99b019.tar.gz
ememify some more calls to tvb_get_string()
this fixes an obvious memleak in ms-mms svn path=/trunk/; revision=15132
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-dcerpc-nt.c4
-rw-r--r--epan/dissectors/packet-ieee80211.c3
-rw-r--r--epan/dissectors/packet-ms-mms.c2
-rw-r--r--epan/dissectors/packet-multipart.c3
4 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c
index 6c27cf249b..5a1bd4aaa5 100644
--- a/epan/dissectors/packet-dcerpc-nt.c
+++ b/epan/dissectors/packet-dcerpc-nt.c
@@ -1082,7 +1082,7 @@ void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_,
* some way we can get that string, rather than duplicating the
* efforts of that routine?
*/
- s = tvb_get_string(
+ s = ep_tvb_get_string(
tvb, start_offset + 12, (end_offset - start_offset - 12) );
/* Append string to COL_INFO */
@@ -1118,8 +1118,6 @@ void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_,
dcv->private_data = g_strdup(s);
}
-
- g_free(s);
}
/* Dissect a pointer to a NDR string and append the string value to the
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index a5c8d06de1..f1a00ca6c0 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -1328,7 +1328,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
{
char *ssid;
- ssid = tvb_get_string(tvb, offset + 2, tag_len);
+ ssid = ep_tvb_get_string(tvb, offset + 2, tag_len);
proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
tag_len, ssid);
if (check_col (pinfo->cinfo, COL_INFO)) {
@@ -1345,7 +1345,6 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
} else {
proto_item_append_text(ti, ": Broadcast");
}
- g_free(ssid);
beacon_padding++; /* padding bug */
}
break;
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c
index ce70a913e7..91de7f35f2 100644
--- a/epan/dissectors/packet-ms-mms.c
+++ b/epan/dissectors/packet-ms-mms.c
@@ -399,7 +399,7 @@ static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += 4;
/* Protocol name. Must be "MMS"... */
- if (strncmp(tvb_get_string(tvb, offset, 3), "MMS", 3) != 0)
+ if (strncmp(ep_tvb_get_string(tvb, offset, 3), "MMS", 3) != 0)
{
return 0;
}
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 64afba27b1..cf6063da82 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -559,11 +559,10 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
while (line_len > 0)
{
gint colon_offset;
- char *hdr_str = tvb_get_string(tvb, offset, next_offset - offset);
+ char *hdr_str = ep_tvb_get_string(tvb, offset, next_offset - offset);
char *header_str;
header_str = unfold_and_compact_mime_header(hdr_str, &colon_offset);
- g_free(hdr_str);
if (colon_offset <= 0) {
if (tree) {
proto_tree_add_text(subtree, tvb, offset, next_offset - offset,