From: Eric Leblond Date: Wed, 22 Aug 2018 22:21:51 +0000 (+0200) Subject: log-filestore: fix file descriptor leak X-Git-Tag: suricata-4.0.6~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d2fc7019006c4c766c3458c51f8385d1b03afe9;p=thirdparty%2Fsuricata.git log-filestore: fix file descriptor leak 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 for the analysis. --- diff --git a/src/log-filestore.c b/src/log-filestore.c index 8777b4a60f..aa94ddeedd 100644 --- a/src/log-filestore.c +++ b/src/log-filestore.c @@ -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) {