From 6d2fc7019006c4c766c3458c51f8385d1b03afe9 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 23 Aug 2018 00:21:51 +0200 Subject: [PATCH] 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. --- src/log-filestore.c | 1 + 1 file changed, 1 insertion(+) 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) { -- 2.47.2