]> 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>
Wed, 29 Aug 2018 10:20:11 +0000 (12:20 +0200)
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 7f1f2484b94ce6db4ef79d8bd6d66221023f6c20..a108118b8efe5403c2c9046a0a47bb16fc0b5af6 100644 (file)
@@ -461,6 +461,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) {