aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index e04d5b452..b7c2054d9 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -3433,8 +3433,11 @@ void * processing_thread(void *_thread_id) {
pcap_loop:
runPcapLoop(thread_id);
- pcap_close(ndpi_thread_info[thread_id].workflow->pcap_handle);
+ if(ndpi_thread_info[thread_id].workflow->pcap_handle)
+ pcap_close(ndpi_thread_info[thread_id].workflow->pcap_handle);
+
ndpi_thread_info[thread_id].workflow->pcap_handle = NULL;
+
if(playlist_fp[thread_id] != NULL) { /* playlist: read next file */
char filename[256];