summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ndps.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ndps.c')
-rw-r--r--epan/dissectors/packet-ndps.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index a8565f16cd..0feaaee10b 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -4079,16 +4079,18 @@ ndps_hash(gconstpointer v)
static void
ndps_init_protocol(void)
{
- /* fragment */
reassembly_table_init(&ndps_reassembly_table,
&addresses_reassembly_table_functions);
-
- if (ndps_req_hash)
- g_hash_table_destroy(ndps_req_hash);
-
ndps_req_hash = g_hash_table_new(ndps_hash, ndps_equal);
}
+static void
+ndps_cleanup_protocol(void)
+{
+ reassembly_table_destroy(&ndps_reassembly_table);
+ /* ndps_req_hash is already destroyed by ndps_postseq_cleanup */
+}
+
/* After the sequential run, we don't need the ncp_request hash and keys
* anymore; the lookups have already been done and the vital info
* saved in the reply-packets' private_data in the frame_data struct. */
@@ -4100,7 +4102,7 @@ ndps_postseq_cleanup(void)
g_hash_table_destroy(ndps_req_hash);
ndps_req_hash = NULL;
}
- /* Don't free the ncp_req_hash_values, as they're
+ /* Don't free the ndps_req_hash_value values of ndps_req_hash, as they're
* needed during random-access processing of the proto_tree.*/
}
@@ -9513,6 +9515,7 @@ proto_register_ndps(void)
&ndps_show_oids);
register_init_routine(&ndps_init_protocol);
+ register_cleanup_routine(&ndps_cleanup_protocol);
register_postseq_cleanup_routine(&ndps_postseq_cleanup);
}