diff --git a/src/source-pcap-file-helper.c b/src/source-pcap-file-helper.c index 7a4f67803d..d861f7ee1b 100644 --- a/src/source-pcap-file-helper.c +++ b/src/source-pcap-file-helper.c @@ -41,7 +41,7 @@ void CleanupPcapFileFileVars(PcapFileFileVars *pfv) pfv->pcap_handle = NULL; } if (pfv->filename != NULL) { - if (pfv->shared->should_delete) { + if (pfv->shared != NULL && pfv->shared->should_delete) { SCLogDebug("Deleting pcap file %s", pfv->filename); if (unlink(pfv->filename) != 0) { SCLogWarning(SC_ERR_PCAP_FILE_DELETE_FAILED,