]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pcap-log: close pcap_dead_handle on close
authorJason Ish <jason.ish@oisf.net>
Wed, 28 Jun 2023 17:06:24 +0000 (11:06 -0600)
committerJason Ish <jason.ish@oisf.net>
Sat, 1 Jul 2023 14:55:41 +0000 (08:55 -0600)
Fixes leaked handle on exit.

(cherry picked from commit 8511ef5e2db4484424bc7cde058d57b8401e5005)

src/log-pcap.c

index 8ac213723218058f3a6e49267dea8b0e78a5d138..092ab8bdd4e52d8378b82aa46a4e7aec6afd9580 100644 (file)
@@ -1028,6 +1028,10 @@ static void PcapLogDataFree(PcapLogData *pl)
     SCFree(pl->filename);
     SCFree(pl->prefix);
 
+    if (pl->pcap_dead_handle) {
+        pcap_close(pl->pcap_dead_handle);
+    }
+
 #ifdef HAVE_LIBLZ4
     if (pl->compression.format == PCAP_LOG_COMPRESSION_FORMAT_LZ4) {
         SCFree(pl->compression.buffer);