diff options
Diffstat (limited to 'epan/dissectors/packet-afs.c')
-rw-r--r-- | epan/dissectors/packet-afs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c index 9613533774..1e9a5dac12 100644 --- a/epan/dissectors/packet-afs.c +++ b/epan/dissectors/packet-afs.c @@ -1415,17 +1415,18 @@ afs_hash (gconstpointer v) static void afs_init_protocol(void) { - if (afs_request_hash) - g_hash_table_destroy(afs_request_hash); - afs_request_hash = g_hash_table_new(afs_hash, afs_equal); - - /* fragment_table_init(&afs_fragment_table); */ - /* reassembled_table_init(&afs_reassembled_table); */ reassembly_table_init(&afs_reassembly_table, &addresses_reassembly_table_functions); } +static void +afs_cleanup_protocol(void) +{ + reassembly_table_destroy(&afs_reassembly_table); + g_hash_table_destroy(afs_request_hash); +} + /* * Here is a helper routine for adding an AFS acl to the proto tree * This is to be used with FS packets only @@ -3631,6 +3632,7 @@ proto_register_afs(void) proto_register_field_array(proto_afs, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_init_routine(&afs_init_protocol); + register_cleanup_routine(&afs_cleanup_protocol); new_register_dissector("afs", dissect_afs, proto_afs); } |