]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log-filestore: fix file descriptor leak
authorEric Leblond <eric@regit.org>
Wed, 22 Aug 2018 22:21:51 +0000 (00:21 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 1 Nov 2018 14:46:10 +0000 (15:46 +0100)
In the case we exceed the number of simultaneously open
file we can reach a state were we will not close the file
after writing.

Thanks to Steve Grubb <sgrubb@redhat.com> for the analysis.

src/log-filestore.c

index 8777b4a60fdc98733118b98efbe1bdefeff6bc2c..aa94ddeeddcb4325965d6c0182a12be1019491f0 100644 (file)
@@ -391,6 +391,7 @@ static int LogFilestoreLogger(ThreadVars *tv, void *thread_data, const Packet *p
             if (FileGetMaxOpenFiles() > 0) {
                 StatsIncr(tv, aft->counter_max_hits);
             }
+            ff->fd = -1;
         }
     /* we can get called with a NULL ffd when we need to close */
     } else if (data != NULL) {