]> 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>
Wed, 28 Jun 2023 18:36:18 +0000 (12:36 -0600)
Fixes leaked handle on exit.

src/log-pcap.c

index 2fe15197b8207e9fbbd8b043cbc300267d2303cb..1e1b6da1fb55dbf543625a81f91a44dfa7de87ba 100644 (file)
@@ -1187,6 +1187,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);