aboutsummaryrefslogtreecommitdiffstats
path: root/packet-http.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-08-14 00:40:14 +0000
committerTim Potter <tpot@samba.org>2002-08-14 00:40:14 +0000
commit51e4328d8e30892867433bd47fbdc51b90f3bb51 (patch)
treed97091c41635bdd0f7beaa2fa82418e3fe2325cb /packet-http.c
parentda901e74347384e64260f39448134833d16f7202 (diff)
downloadwireshark-51e4328d8e30892867433bd47fbdc51b90f3bb51.tar.gz
wireshark-51e4328d8e30892867433bd47fbdc51b90f3bb51.tar.bz2
wireshark-51e4328d8e30892867433bd47fbdc51b90f3bb51.zip
Fixed memory leak in creation of new tvb for ntlmssp data.
Call tvb_set_child_real_data_tvbuff() and add_new_data_source() to fix the display problem when dissecting ntlmssp over http packets. It works better now, but for some reason the ntlmssp challenge packet is still not displayed correctly. Thanks to Guy for the tips. svn path=/trunk/; revision=5991
Diffstat (limited to 'packet-http.c')
-rw-r--r--packet-http.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/packet-http.c b/packet-http.c
index 9f89b57d7c..ff30a95f61 100644
--- a/packet-http.c
+++ b/packet-http.c
@@ -6,7 +6,7 @@
* Copyright 2002, Tim Potter <tpot@samba.org>
* Copyright 1999, Andrew Tridgell <tridge@samba.org>
*
- * $Id: packet-http.c,v 1.53 2002/08/13 09:10:02 guy Exp $
+ * $Id: packet-http.c,v 1.54 2002/08/14 00:40:14 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -137,17 +137,19 @@ base64_to_tvb(char *base64)
len = base64_decode(data);
tvb = tvb_new_real_data(data, len, len);
- /* XXX: need to set free function */
+ tvb_set_free_cb(tvb, g_free);
return tvb;
}
static void
-dissect_http_ntlmssp(packet_info *pinfo, proto_tree *tree, char *line)
+dissect_http_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char *line)
{
tvbuff_t *ntlmssp_tvb;
ntlmssp_tvb = base64_to_tvb(line);
+ tvb_set_child_real_data_tvbuff(tvb, ntlmssp_tvb);
+ add_new_data_source(pinfo, ntlmssp_tvb, "NTLMSSP Data");
call_dissector(ntlmssp_handle, ntlmssp_tvb, pinfo, tree);
@@ -312,14 +314,14 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hdr_tree = proto_item_add_subtree(
hdr_item, ett_http_ntlmssp);
text += strlen(NTLMSSP_AUTH);
- dissect_http_ntlmssp(pinfo, hdr_tree, text);
+ dissect_http_ntlmssp(tvb, pinfo, hdr_tree, text);
}
if (strncmp(text, NTLMSSP_WWWAUTH, strlen(NTLMSSP_WWWAUTH)) == 0) {
hdr_tree = proto_item_add_subtree(
hdr_item, ett_http_ntlmssp);
text += strlen(NTLMSSP_WWWAUTH);
- dissect_http_ntlmssp(pinfo, hdr_tree, text);
+ dissect_http_ntlmssp(tvb, pinfo, hdr_tree, text);
}
}
offset = next_offset;