diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-08-06 11:23:55 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-08-06 21:22:13 +0000 |
commit | ff24ecceb976e25cf58040b116f25fc218290540 (patch) | |
tree | b6568500814f3dde7bd88e3433af58c503ba9693 /epan/stat_tap_ui.c | |
parent | 9fd3bcc25e0b6c1feaf6e20850200de4acf5637a (diff) |
Fixup stat_tap table freeing.
As it turns out we *do* need to free table elements. We also need to
free the tables themselves and clear the table array. Do so.
Change-Id: Ic1c81388eac8f47f74caea0169c79685a83aaff9
Reviewed-on: https://code.wireshark.org/review/9901
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/stat_tap_ui.c')
-rw-r--r-- | epan/stat_tap_ui.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/stat_tap_ui.c b/epan/stat_tap_ui.c index a6f8761e7a..6242adca3f 100644 --- a/epan/stat_tap_ui.c +++ b/epan/stat_tap_ui.c @@ -251,7 +251,7 @@ void reset_stat_table(new_stat_tap_ui* new_stat, new_stat_tap_gui_reset_cb gui_c } } -void free_stat_table(new_stat_tap_ui* new_stat, new_stat_tap_gui_free_cb gui_callback, void *callback_data) +void free_stat_tables(new_stat_tap_ui* new_stat, new_stat_tap_gui_free_cb gui_callback, void *callback_data) { guint i = 0, element, field_index; new_stat_tap_table *stat_table; @@ -271,11 +271,16 @@ void free_stat_table(new_stat_tap_ui* new_stat, new_stat_tap_gui_free_cb gui_cal { field_data = new_stat_tap_get_field_data(stat_table, element, field_index); /* Give dissector a crack at it */ + /* XXX Should this be per-row instead? */ if (new_stat->stat_tap_free_table_item_cb) new_stat->stat_tap_free_table_item_cb(stat_table, element, field_index, field_data); } + g_free(stat_table->elements[element]); } + g_free(stat_table->elements); + g_free(stat_table); } + g_array_set_size(new_stat->tables, 0); } |