aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/file.c b/file.c
index e90ae240a3..4beb1f2065 100644
--- a/file.c
+++ b/file.c
@@ -557,6 +557,12 @@ cf_finish_tail(capture_file *cf, int *err)
int fd;
struct stat cf_stat;
+
+ if(cf->wth == NULL) {
+ cf_close(cf);
+ return CF_READ_ERROR;
+ }
+
packet_list_freeze();
while ((wtap_read(cf->wth, err, &err_info, &data_offset))) {