Qt: handle a failed open file the right way (CID: 1159174).

Change-Id: Ia639a4b530cc9fdf7b72887031bc029c065d2162
Reviewed-on: https://code.wireshark.org/review/25048
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2017-12-28 22:52:26 +01:00 committed by Michael Mann
parent 727fac4559
commit c7c5e2abb1
1 changed files with 7 additions and 2 deletions

View File

@ -111,8 +111,13 @@ void SCTPChunkStatisticsDialog::fillTable(bool all)
} else {
fp = ws_fopen(fname,"r");
if (!fp && errno == ENOENT) {
init = true;
if (!fp) {
if (errno == ENOENT) {
init = true;
} else {
g_log(NULL, G_LOG_LEVEL_ERROR, "Can't open %s: %s", fname, g_strerror(errno));
return;
}
}
}
g_free (fname);