wiretap: add open_routines cleanup function.

Change-Id: Id88fe84189b8baa597eaa69159395cdc4bc56195
Reviewed-on: https://code.wireshark.org/review/19951
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2017-02-04 17:01:00 +01:00 committed by Michael Mann
parent 52637ad6f6
commit 67d8830f2f
3 changed files with 17 additions and 0 deletions

View File

@ -2718,6 +2718,20 @@ wtap_dump_file_tell(wtap_dumper *wdh, int *err)
}
}
void
cleanup_open_routines(void)
{
guint i;
struct open_info *i_open;
for (i = 0, i_open = open_routines; i < open_info_arr->len; i++, i_open++) {
if (i_open->extensions != NULL)
g_strfreev(i_open->extensions_set);
}
g_array_free(open_info_arr, TRUE);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -1444,6 +1444,7 @@ wtap_cleanup(void)
wtap_cleanup_encap_types();
wtap_opttypes_cleanup();
ws_buffer_cleanup();
cleanup_open_routines();
}
/*

View File

@ -1448,6 +1448,8 @@ typedef enum {
WS_DLL_PUBLIC void init_open_routines(void);
void cleanup_open_routines(void);
struct open_info {
const char *name;
wtap_open_type type;