aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tacacs.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-20 09:54:11 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-20 09:54:11 +0000
commit7a310a6502e699391bfac15f90bcd76274d1340d (patch)
tree52098dbfcf186422b7f2226410ef4e483bfe2a7c /packet-tacacs.c
parentb822ccbf890bf3f8521b2f58c2a53766824da78c (diff)
Arrange to free the buffer allocated for the decrypted tvbuff.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8507 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tacacs.c')
-rw-r--r--packet-tacacs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/packet-tacacs.c b/packet-tacacs.c
index ebb3dcabdd..8fe0eabf7c 100644
--- a/packet-tacacs.c
+++ b/packet-tacacs.c
@@ -5,7 +5,7 @@
* Full Tacacs+ parsing with decryption by
* Emanuele Caratti <wiz@iol.it>
*
- * $Id: packet-tacacs.c,v 1.25 2003/09/20 09:41:48 guy Exp $
+ * $Id: packet-tacacs.c,v 1.26 2003/09/20 09:54:11 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -339,8 +339,19 @@ tacplus_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pinfo, guint3
md5_xor( buff, tacplus_key, len, tmp_sess,version, tvb_get_guint8(tvb,2) );
+ /* Allocate a new tvbuff, referring to the decrypted data. */
*dst_tvb = tvb_new_real_data( buff, len, len );
+
+ /* Arrange that the allocated packet data copy be freed when the
+ tvbuff is freed. */
+ tvb_set_free_cb( *dst_tvb, g_free );
+
+ /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
+ were handed refers, so it'll get cleaned up when that tvbuff
+ is cleaned up. */
tvb_set_child_real_data_tvbuff( tvb, *dst_tvb );
+
+ /* Add the decrypted data to the data source list. */
add_new_data_source(pinfo, *dst_tvb, "TACACS+ Decrypted");
return 0;