diff options
Diffstat (limited to 'epan/dissectors/packet-mgcp.c')
-rw-r--r-- | epan/dissectors/packet-mgcp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c index 21b5fdfdbb..d015d07669 100644 --- a/epan/dissectors/packet-mgcp.c +++ b/epan/dissectors/packet-mgcp.c @@ -670,15 +670,14 @@ static void mgcp_raw_text_add(tvbuff_t *tvb, proto_tree *tree) /* Discard and init any state we've saved */ static void mgcp_init_protocol(void) { - if (mgcp_calls != NULL) - { - g_hash_table_destroy(mgcp_calls); - mgcp_calls = NULL; - } - mgcp_calls = g_hash_table_new(mgcp_call_hash, mgcp_call_equal); } +static void mgcp_cleanup_protocol(void) +{ + g_hash_table_destroy(mgcp_calls); +} + /* * is_mgcp_verb - A function for determining whether there is a @@ -2307,6 +2306,7 @@ void proto_register_mgcp(void) proto_register_field_array(proto_mgcp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_init_routine(&mgcp_init_protocol); + register_cleanup_routine(&mgcp_cleanup_protocol); new_register_dissector("mgcp", dissect_mgcp, proto_mgcp); |