diff options
Diffstat (limited to 'epan/dissectors/packet-dcerpc-nt.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-nt.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 2f463288e8..5a6b6a4087 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -870,18 +870,14 @@ gboolean dcerpc_fetch_polhnd_data(e_ctx_hnd *policy_hnd, static void init_pol_hash(void) { - /* Initialise hash table */ - - if (pol_hash) { - /* Everything in the table is allocated with wmem file - * scope so there's no need to go through and free it all. - */ - g_hash_table_destroy(pol_hash); - } - pol_hash = g_hash_table_new(pol_hash_fn, pol_hash_compare); } +static void cleanup_pol_hash(void) +{ + g_hash_table_destroy(pol_hash); +} + /* Dissect a NT status code */ int @@ -2025,6 +2021,7 @@ void dcerpc_smb_init(int proto_dcerpc) expert_dcerpc_nt = expert_register_protocol(proto_dcerpc); expert_register_field_array(expert_dcerpc_nt, ei, array_length(ei)); register_init_routine(&init_pol_hash); + register_cleanup_routine(&cleanup_pol_hash); } /* |