diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-06-27 15:33:42 -0700 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-07-04 00:17:14 +0000 |
commit | 3243b6f964c96f0137fc3fffd66a74dd9f7910fd (patch) | |
tree | cb4c47ada88b45cd7f6b1835cd412d1d60b746c2 /epan/dissectors/packet-rtse.c | |
parent | 7b33634cc562ba0ee75536b7dde4268a20d89bee (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-rtse.c')
-rw-r--r-- | epan/dissectors/packet-rtse.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c index f0bf602364..f91406d4c6 100644 --- a/epan/dissectors/packet-rtse.c +++ b/epan/dissectors/packet-rtse.c @@ -858,6 +858,11 @@ static void rtse_reassemble_init (void) &addresses_reassembly_table_functions); } +static void rtse_reassemble_cleanup(void) +{ + reassembly_table_destroy(&rtse_reassembly_table); +} + /*--- proto_register_rtse -------------------------------------------*/ void proto_register_rtse(void) { @@ -1002,7 +1007,7 @@ void proto_register_rtse(void) { NULL, HFILL }}, /*--- End of included file: packet-rtse-hfarr.c ---*/ -#line 358 "../../asn1/rtse/packet-rtse-template.c" +#line 363 "../../asn1/rtse/packet-rtse-template.c" }; /* List of subtrees */ @@ -1024,7 +1029,7 @@ void proto_register_rtse(void) { &ett_rtse_CallingSSuserReference, /*--- End of included file: packet-rtse-ettarr.c ---*/ -#line 367 "../../asn1/rtse/packet-rtse-template.c" +#line 372 "../../asn1/rtse/packet-rtse-template.c" }; static ei_register_info ei[] = { @@ -1045,6 +1050,7 @@ void proto_register_rtse(void) { expert_rtse = expert_register_protocol(proto_rtse); expert_register_field_array(expert_rtse, ei, array_length(ei)); register_init_routine (&rtse_reassemble_init); + register_cleanup_routine (&rtse_reassemble_cleanup); rtse_module = prefs_register_protocol_subtree("OSI", proto_rtse, NULL); prefs_register_bool_preference(rtse_module, "reassemble", |