]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
af-packet: free ring buffer at exit
authorEric Leblond <eric@regit.org>
Mon, 1 Jan 2018 18:03:24 +0000 (19:03 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 4 Jan 2018 18:20:16 +0000 (19:20 +0100)
src/source-af-packet.c

index 11a872ae4f5bff5ec213463db1aa46cae4c5da3f..be8530f9a5a502ff21c3acd8dc7e86b17bfb395d 100644 (file)
@@ -2264,6 +2264,12 @@ TmEcode ReceiveAFPThreadDeinit(ThreadVars *tv, void *data)
     ptv->datalen = 0;
 
     ptv->bpf_filter = NULL;
+    if ((ptv->flags & AFP_TPACKET_V3) && ptv->ring_v3) {
+        SCFree(ptv->ring_v3);
+    } else {
+        if (ptv->ring_v2)
+            SCFree(ptv->ring_v2);
+    }
 
     SCFree(ptv);
     SCReturnInt(TM_ECODE_OK);