aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2005-07-24 02:43:20 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2005-07-24 02:43:20 +0000
commit910f98eb86c4662c25a66106f502395f18304a83 (patch)
tree229f3b8c3d3d0c86ed517f488735e303eeb630da
parent378cc8ac46861fbd3e777f1987598bcf67028fa1 (diff)
Replace two calls to tvb_get_string with the new ep_tvb_get_string (this fixes a leak I introdduced at the last checkin)
remove the stat_infos PtrArray as we do not need to free our tap data anymore, YEAH! svn path=/trunk/; revision=15026
-rw-r--r--epan/dissectors/packet-http.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 73ebdfd9c0..443379c479 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -455,15 +455,6 @@ dissect_http_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
static http_info_value_t *stat_info;
-/*
- * As the http_info_value_t will contain much more allocated data than it
- * used to, we'll keep the stat_infos for this frame in this array.
- *
- * we'll clean it at every call of dissect_http_message() leaving in the array
- * only those stat_infos that belong to the current frame
- */
-static GPtrArray* stat_infos;
-
static int
dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree)
@@ -535,21 +526,6 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
stat_info->request_uri = NULL;
stat_info->http_host = NULL;
- /* We'll then delete from the array all the stat_infos that do not belong to this frame */
- i = stat_infos->len;
- while (i) {
- --i;
-
- si = g_ptr_array_index(stat_infos,i);
-
- if ( si->framenum != framenum ) {
- g_ptr_array_remove_index_fast(stat_infos,i);
- }
- }
-
- /* then we'll add the current stat_info to the array */
- g_ptr_array_add(stat_infos,stat_info);
-
switch (pinfo->match_port) {
case TCP_PORT_SSDP: /* TCP_PORT_SSDP = UDP_PORT_SSDP */
@@ -1167,7 +1143,7 @@ basic_request_dissector(tvbuff_t *tvb, proto_tree *tree, int offset,
tokenlen = get_token_len(line, lineend, &next_token);
if (tokenlen == 0)
return;
- stat_info->request_uri = (gchar*) tvb_get_string(tvb, offset, tokenlen);
+ stat_info->request_uri = (gchar*) ep_tvb_get_string(tvb, offset, tokenlen);
proto_tree_add_string(tree, hf_http_request_uri, tvb, offset, tokenlen,
stat_info->request_uri);
offset += next_token - line;
@@ -1258,7 +1234,7 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
break;
}
- chunk_string = tvb_get_string(tvb, offset, linelen);
+ chunk_string = ep_tvb_get_string(tvb, offset, linelen);
if (chunk_string == NULL) {
/* Can't get the chunk size line */
@@ -1275,12 +1251,9 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
}
if ( ( chunk_size = strtol((gchar*)chunk_string, NULL, 16) ) == 0 ) {
- g_free(chunk_string);
break;
}
- g_free(chunk_string);
-
if (chunk_size > datalen) {
/*
@@ -2105,8 +2078,6 @@ proto_register_http(void)
* Register for tapping
*/
http_tap = register_tap("http");
-
- stat_infos = g_ptr_array_new();
}
/*