summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-aoe.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-aoe.c')
-rw-r--r--epan/dissectors/packet-aoe.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/epan/dissectors/packet-aoe.c b/epan/dissectors/packet-aoe.c
index df51b47bf0..5369bfc50f 100644
--- a/epan/dissectors/packet-aoe.c
+++ b/epan/dissectors/packet-aoe.c
@@ -392,18 +392,15 @@ dissect_aoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
static void
ata_init(void)
{
- if(ata_cmd_unmatched){
- g_hash_table_destroy(ata_cmd_unmatched);
- ata_cmd_unmatched=NULL;
- }
ata_cmd_unmatched=g_hash_table_new(ata_cmd_hash_unmatched, ata_cmd_equal_unmatched);
-
- if(ata_cmd_matched){
- g_hash_table_destroy(ata_cmd_matched);
- ata_cmd_matched=NULL;
- }
ata_cmd_matched=g_hash_table_new(ata_cmd_hash_matched, ata_cmd_equal_matched);
+}
+static void
+ata_cleanup(void)
+{
+ g_hash_table_destroy(ata_cmd_unmatched);
+ g_hash_table_destroy(ata_cmd_matched);
}
void
@@ -475,6 +472,7 @@ proto_register_aoe(void)
aoe_handle = register_dissector("aoe", dissect_aoe, proto_aoe);
register_init_routine(ata_init);
+ register_cleanup_routine(ata_cleanup);
}
void