aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-03-15 13:46:42 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-03-15 13:46:42 +0000
commitdc674a60434c30dfcfb28692bb187e6710157b94 (patch)
tree8dae696d82040e23c375cba3c03dbafc6e5b6ecc /wiretap/wtap.c
parentb1a9d50e035a98dd03ed0485f5b090e43403d49d (diff)
- Store ISB data.
- free IDB and ISB data when closing. svn path=/trunk/; revision=41558
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r--wiretap/wtap.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index f1f8212ccd..9485ba7c7d 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -718,6 +718,10 @@ g_fast_seek_item_free(gpointer data, gpointer user_data _U_)
void
wtap_close(wtap *wth)
{
+ gint i;
+ wtapng_if_descr_t *wtapng_if_descr;
+ wtapng_if_stats_t *if_stats;
+
wtap_sequential_close(wth);
if (wth->subtype_close != NULL)
@@ -733,6 +737,39 @@ wtap_close(wtap *wth)
g_ptr_array_foreach(wth->fast_seek, g_fast_seek_item_free, NULL);
g_ptr_array_free(wth->fast_seek, TRUE);
}
+ for(i = 0; i < (gint)wth->number_of_interfaces; i++) {
+ wtapng_if_descr = &g_array_index(wth->interface_data, wtapng_if_descr_t, i);
+ if(wtapng_if_descr->opt_comment != NULL){
+ g_free(wtapng_if_descr->opt_comment);
+ }
+ if(wtapng_if_descr->if_name != NULL){
+ g_free(wtapng_if_descr->if_name);
+ }
+ if(wtapng_if_descr->if_description != NULL){
+ g_free(wtapng_if_descr->if_description);
+ }
+ if(wtapng_if_descr->if_filter_str != NULL){
+ g_free(wtapng_if_descr->if_filter_str);
+ }
+ if(wtapng_if_descr->if_filter_bpf_bytes != NULL){
+ g_free(wtapng_if_descr->if_filter_bpf_bytes);
+ }
+ if(wtapng_if_descr->if_os != NULL){
+ g_free(wtapng_if_descr->if_os);
+ }
+ for(i = 0; i < (gint)wtapng_if_descr->num_stat_entries; i++) {
+ if_stats = &g_array_index(wtapng_if_descr->interface_statistics, wtapng_if_stats_t, i);
+ if(if_stats->opt_comment != NULL){
+ g_free(if_stats->opt_comment);
+ }
+ }
+ if(wtapng_if_descr->num_stat_entries != 0){
+ g_array_free(wtapng_if_descr->interface_statistics, TRUE);
+ }
+ }
+ if(wth->number_of_interfaces != 0){
+ g_array_free(wth->interface_data, TRUE);
+ }
g_free(wth);
}