aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2021-10-03 21:16:16 +0200
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-10-04 07:15:11 +0000
commite866034c55a139587d1d2d5340802dedbaa81801 (patch)
treeac1c98affd60a7d8a4ae4a46f4e1c7f7f4d3d231 /ui/qt
parent5c185238a49bb6b2120d5a32f75ba99e0891919f (diff)
Qt: Handle errors when reloading Lua FileHandler
Reloading the capture file after reloading a Lua FileHandler may fail because of Lua errors. Handle this by closing the file. Related to #17615
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/main_window_slots.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 01009f53b9..d22b2708aa 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1563,7 +1563,9 @@ void MainWindow::reloadLuaPlugins()
if (uses_lua_filehandler) {
// Reload the file in case the FileHandler has changed
- cf_reload(capture_file_.capFile());
+ if (cf_reload(capture_file_.capFile()) != CF_OK) {
+ cf_close(capture_file_.capFile());
+ }
proto_free_deregistered_fields();
} else {
redissectPackets();