proto: free memory on cleanup.

Change-Id: Ia6cb39cbf6d5b50d39746f38758433a7541219a2
Reviewed-on: https://code.wireshark.org/review/19896
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2017-02-01 13:40:11 +01:00 committed by Michael Mann
parent 401a20dbd4
commit 2cdc1ec3a5
1 changed files with 6 additions and 5 deletions

View File

@ -330,6 +330,9 @@ static GList *pino_protocols = NULL;
static GPtrArray *deregistered_fields = NULL;
static GPtrArray *deregistered_data = NULL;
/* indexed by prefix, contains initializers */
static GHashTable* prefixes = NULL;
/* Contains information about a field when a dissector calls
* proto_tree_add_item. */
#define FIELD_INFO_NEW(pool, fi) fi = wmem_new(pool, field_info)
@ -643,6 +646,9 @@ proto_cleanup(void)
g_free(tree_is_expanded);
tree_is_expanded = NULL;
if (prefixes)
g_hash_table_destroy(prefixes);
}
static gboolean
@ -904,11 +910,6 @@ prefix_equal (gconstpointer ap, gconstpointer bp) {
return FALSE;
}
/* indexed by prefix, contains initializers */
static GHashTable* prefixes = NULL;
/* Register a new prefix for "delayed" initialization of field arrays */
void
proto_register_prefix(const char *prefix, prefix_initializer_t pi ) {