aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-t38.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-06-27 15:33:42 -0700
committerMichael Mann <mmann78@netscape.net>2015-07-04 00:17:14 +0000
commit3243b6f964c96f0137fc3fffd66a74dd9f7910fd (patch)
treecb4c47ada88b45cd7f6b1835cd412d1d60b746c2 /epan/dissectors/packet-t38.c
parent7b33634cc562ba0ee75536b7dde4268a20d89bee (diff)
asn1: split off cleanup routines
General approach: 1. Split allocation (e.g. g_hash_table_new) from deallocation (g_hash_table_destroy) into functions named "init" and "cleanup". 2. Remove guards that test whether the hash tables are set as init is always called before cleanup. 3. Remove setting hash tables to NULL after destruction. 4. Copy register_init_routine function call and change init to cleanup. 5. Add cleanup function that calls reassembly_table_destroy if there is a reassembly_table_init function. Some templates were modified as follows: - snmp: split renew into init+cleanup, but keep renew for the uat_new callback. - ldap,ros: Rename init to cleanup as there was no initialization. - camel: remove init function from header, make it static. Remove debug print. - tcap: remove unused ssn_range assignment. Files in epan/ were regenerated using cmake && make asn1 Change-Id: Idac16ebf0ec304e0c8becaab5d32904e56eb69b9 Reviewed-on: https://code.wireshark.org/review/9136 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-t38.c')
-rw-r--r--epan/dissectors/packet-t38.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c
index 1443766802..015a7655d1 100644
--- a/epan/dissectors/packet-t38.c
+++ b/epan/dissectors/packet-t38.c
@@ -251,6 +251,11 @@ static void t38_defragment_init(void)
&addresses_reassembly_table_functions);
}
+static void t38_defragment_cleanup(void)
+{
+ reassembly_table_destroy(&data_reassembly_table);
+}
+
/* Set up an T38 conversation */
void t38_add_address(packet_info *pinfo,
@@ -977,7 +982,7 @@ static int dissect_UDPTLPacket_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-t38-fn.c ---*/
-#line 392 "../../asn1/t38/packet-t38-template.c"
+#line 397 "../../asn1/t38/packet-t38-template.c"
/* initialize the tap t38_info and the conversation */
static void
@@ -1316,7 +1321,7 @@ proto_register_t38(void)
"OCTET_STRING", HFILL }},
/*--- End of included file: packet-t38-hfarr.c ---*/
-#line 654 "../../asn1/t38/packet-t38-template.c"
+#line 659 "../../asn1/t38/packet-t38-template.c"
{ &hf_t38_setup,
{ "Stream setup", "t38.setup", FT_STRING, BASE_NONE,
NULL, 0x0, "Stream setup, method and frame number", HFILL }},
@@ -1377,7 +1382,7 @@ proto_register_t38(void)
&ett_t38_T_fec_data,
/*--- End of included file: packet-t38-ettarr.c ---*/
-#line 701 "../../asn1/t38/packet-t38-template.c"
+#line 706 "../../asn1/t38/packet-t38-template.c"
&ett_t38_setup,
&ett_data_fragment,
&ett_data_fragments
@@ -1399,6 +1404,7 @@ proto_register_t38(void)
/* Init reassemble tables for HDLC */
register_init_routine(t38_defragment_init);
+ register_cleanup_routine(t38_defragment_cleanup);
t38_tap = register_tap("t38");