Added missing check to prevent crashes

This commit is contained in:
Luca Deri
2021-06-23 12:17:21 +02:00
parent 2234b97149
commit 6a1fd9ad97
+4 -1
View File
@@ -3433,8 +3433,11 @@ void * processing_thread(void *_thread_id) {
pcap_loop: pcap_loop:
runPcapLoop(thread_id); 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; ndpi_thread_info[thread_id].workflow->pcap_handle = NULL;
if(playlist_fp[thread_id] != NULL) { /* playlist: read next file */ if(playlist_fp[thread_id] != NULL) { /* playlist: read next file */
char filename[256]; char filename[256];