diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-06-28 07:35:00 -0700 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-07-03 23:36:37 +0000 |
commit | 7ce77c69ea4f3424616558729ec23cf3dd1de694 (patch) | |
tree | bf3310cb4eb6fccb7dcc29297ef49732a108bdc9 /epan/dissectors/packet-rlc.c | |
parent | f5340b2a07a0a5f6830a091283d3170195203b82 (diff) |
Split four more init routines into init/cleanup
Three of them are trivial movements, the smb-sidsnooping is an odd one.
Ronnie Sahlberg disabled the sid_name_snooping feature on 9 July 2007.
There is a preference to override it though... For now add a TODO
marker and ensure that the hash tables are always initialized.
Change-Id: I61f5e215c9fa72a6785fb48eaa2d50c1975d7483
Reviewed-on: https://code.wireshark.org/review/9227
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-rlc.c')
-rw-r--r-- | epan/dissectors/packet-rlc.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c index 7111a75393..c9e1211aad 100644 --- a/epan/dissectors/packet-rlc.c +++ b/epan/dissectors/packet-rlc.c @@ -557,24 +557,6 @@ static void fragment_table_init(void) { int i; - if (fragment_table) { - g_hash_table_destroy(fragment_table); - } - if (endpoints) { - g_hash_table_destroy(endpoints); - } - if (reassembled_table) { - g_hash_table_destroy(reassembled_table); - } - if (sequence_table) { - g_hash_table_destroy(sequence_table); - } - if (duplicate_table) { - g_hash_table_destroy(duplicate_table); - } - if(counter_map){ - g_tree_destroy(counter_map); - } fragment_table = g_hash_table_new_full(rlc_channel_hash, rlc_channel_equal, rlc_channel_delete, NULL); endpoints = g_hash_table_new_full(rlc_channel_hash, rlc_channel_equal, rlc_channel_delete, NULL); reassembled_table = g_hash_table_new_full(rlc_frag_hash, rlc_frag_equal, @@ -594,6 +576,17 @@ fragment_table_init(void) max_counter = 0; } +static void +fragment_table_cleanup(void) +{ + g_tree_destroy(counter_map); + g_hash_table_destroy(fragment_table); + g_hash_table_destroy(endpoints); + g_hash_table_destroy(reassembled_table); + g_hash_table_destroy(sequence_table); + g_hash_table_destroy(duplicate_table); +} + /* add the list of fragments for this sdu to 'tree' */ static void tree_add_fragment_list(struct rlc_sdu *sdu, tvbuff_t *tvb, proto_tree *tree) @@ -3000,6 +2993,7 @@ proto_register_rlc(void) #endif /* HAVE_UMTS_KASUMI */ register_init_routine(fragment_table_init); + register_cleanup_routine(fragment_table_cleanup); } void |