From 3d3eb159a757c1b7f3abc0d2c81f8e38e206243b Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 18 Nov 2015 09:01:00 -0800 Subject: [PATCH] Revert: Free cf->edt before free cf->epan when redissecting. Instead of freeing cf->edt before clearing the packet list, add an extra check to MainWindow::setMenusForSelectedTreeRow. Semi-blind attempt at fixing bug 11719. This reverts commit 8c211d51ef66b64c708f7ad079e7e7e913ac9f14. This reverts commit da71ccbf778cca5d9c48e010597570a40fd190c0. Bug: 11719 Change-Id: Ifd07be414ffd03a40bdfa7110395c9542bd86fc4 Reviewed-on: https://code.wireshark.org/review/11943 Petri-Dish: Gerald Combs Reviewed-by: Gerald Combs --- file.c | 4 ---- ui/qt/main_window_slots.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/file.c b/file.c index 0b546c91f7..b83bd27138 100644 --- a/file.c +++ b/file.c @@ -1623,10 +1623,6 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item, gb cf->redissecting = TRUE; /* 'reset' dissection session */ - if (cf->edt) { - epan_dissect_free(cf->edt); - cf->edt = NULL; - } epan_free(cf->epan); cf->epan = ws_epan_new(cf); cf->cinfo.epan = cf->epan; diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 689feaee22..abd15ef298 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -1265,7 +1265,7 @@ void MainWindow::setMenusForSelectedTreeRow(field_info *fi) { bool enable = false; QString filter; - if (capture_file_.capFile() && capture_file_.capFile()->edt) { + if (fi && capture_file_.capFile() && capture_file_.capFile()->edt) { enable = conv_filter->is_filter_valid(&capture_file_.capFile()->edt->pi); filter = conv_filter->build_filter_string(&capture_file_.capFile()->edt->pi); }