diff options
Diffstat (limited to 'epan/dissectors/packet-gsm_sms.c')
-rw-r--r-- | epan/dissectors/packet-gsm_sms.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index 3b0ab8541f..5c84776d31 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -334,12 +334,16 @@ gsm_sms_defragment_init (void) { reassembly_table_init(&g_sm_reassembly_table, &addresses_reassembly_table_functions); - if (g_sm_fragment_params_table) { - g_hash_table_destroy(g_sm_fragment_params_table); - } g_sm_fragment_params_table = g_hash_table_new(g_direct_hash, g_direct_equal); } +static void +gsm_sms_defragment_cleanup (void) +{ + reassembly_table_destroy(&g_sm_reassembly_table); + g_hash_table_destroy(g_sm_fragment_params_table); +} + /* * this is the GSM 03.40 definition with the bit 2 * set to 1 for uplink messages @@ -3285,6 +3289,7 @@ proto_register_gsm_sms(void) /* GSM SMS UD dissector initialization routines */ register_init_routine (gsm_sms_defragment_init); + register_cleanup_routine (gsm_sms_defragment_cleanup); } /* |